Can we predict maize yield from soil, treatment and location?

A linear yield model with R² = 0.623 and RMSE = 1.24 t/ha — and why statistical significance alone doesn’t make a good prediction tool.
Statistics
Predictive Modelling
Agricultural Analytics
Case Study
Author

Victor Mandela

Published

11 September 2026

Keywords

agricultural analytics, R Shiny dashboard, maize yield, Rwanda, statistics, predictive modelling

Open to roles & consulting · M&E · Impact Evaluation · Agricultural Analytics · R Shiny LinkedInGitHubEmailBook a call
Portfolio Edition ••• Monitoring & Evaluation · Impact Evaluation · R Shiny Decision Support ••• Nairobi, KenyaUPDATED NOV 2026

I explored this with a linear model:

Yield ~ Soil pH + Nitrogen + Treatment + District

Can we predict maize yield from soil, treatment and location? — infographic

The results

  • R² = 0.623 — explains about 62% of yield variation
  • RMSE = 1.24 t/ha
  • Overall model significant at p < 0.001

The important part

A statistically significant p-value doesn’t automatically make a model a good prediction tool. You still have to ask:

  • How much variation is left unexplained?
  • How large are the errors relative to the decision?
  • Where does it perform well or poorly?
  • Would anyone actually decide differently because of it?

An RMSE of 1.24 t/ha is good enough to rank strategies and flag weak environments. It is not precise enough to promise an individual farmer a number. Saying so is part of the job.

▶ Try it yourself — live R Shiny demo. Open the Rwanda Maize Yield Analyzer · Username: test · Password: test