Basics to Pro For plant and animal scientists, students and extension workers

Statistics for Agricultural Experiments: A Step-by-Step Guide

Learn statistics the way a graduate course in agricultural experiments teaches it, one chapter building on the last: what statistics is, describing data, hypotheses and p values, statistical power, designing an experiment, then t-tests, ANOVA, factorials, mixed models, repeated measures and models for counts and percentages. Every chapter works through the same two real-world trials, one in the barn and one in the field.

Start with chapter 1

Two trials, followed from start to finish

In the barn: a pig feeding trial

Twenty-four weaned pigs from six litters. Within each litter, four pigs are assigned at random to a control diet or one of three supplemented diets (A, B and C). Over six weeks we record start weight, feed intake, average daily gain (ADG), weekly weights, and which pigs had scours and for how many days.

pig-feeding-trial.csv · pig-weights-weekly.csv

In the field: a wheat nitrogen trial

Two wheat varieties and five nitrogen rates (0 to 160 kg N/ha) in four blocks, laid out as a split-plot: varieties on main plots, nitrogen rates on the subplots within them. We record grain yield (t/ha) and how many of 100 seeds emerged in each plot.

wheat-nitrogen-trial.csv

The data are simulated to behave like real trials, so every number in the guide can be checked. Open any file in aStat to follow along.

Coming from SAS? A free alternative for the same analyses

Graduate courses in animal and plant science are often taught in SAS. Every chapter here shows the SAS code next to the R code, and aStat runs the R version in your browser: no license, no installation, and your data stay on your computer.

In SASIn RIn this guide and aStat
PROC MEANS, PROC UNIVARIATEsummary(), sd(), shapiro.test()Descriptive statistics · Normality Test
PROC TTESTt.test()The t-test
PROC NPAR1WAYwilcox.test(), kruskal.test()The t-test
PROC CORR, PROC REGcor.test(), lm()Correlation and regression
PROC GLM, PROC ANOVAlm(), anova(), emmeans()ANOVA (analysis of variance) · ANOVA Calculator
LSMEANS / ADJUST=TUKEY LINESemmeans(), pairs(), cld()Post hoc tests · ANOVA Calculator
PROC MIXEDlmer() (lme4), gls() (nlme)Mixed models: fixed and random effects
PROC MIXED with REPEATEDgls() with corAR1(), corSymm()Repeated measures and crossover designs
PROC GLIMMIX, PROC GENMODglm(), glmer(), glm.nb()Generalized linear models
PROC NLINnls()Dose-response and quadratic regression
PROC POWER, PROC GLMPOWERpower.t.test(), power.anova.test()Statistical power and sample size · Plan a study
PROC PLANsample()Experimental design · Plan a study
MANOVA statement in PROC GLMmanova()MANOVA and multivariate analysis

SAS is a registered trademark of SAS Institute Inc. aStat is independent and not affiliated with SAS Institute.

The chapters

Practice with your own data

  • ANOVA Calculator One-way (CRD), two-way and RCBD, with Tukey, Duncan or LSD letters.
  • Normality Test Shapiro-Wilk, Q-Q plot and histogram, with advice.
  • EBV Calculator Estimated breeding values, EPDs and heritability, from formulas or BLUP.
  • t-Test Calculator One-sample, two-sample, Welch and paired t-tests, from data or from means and SDs.
  • CV Calculator Coefficient of variation from a list of numbers or from the mean and SD.
  • Heritability Calculator Narrow- and broad-sense heritability from variances or from relatives.
  • Plan a study Randomized layouts for nine designs, and sample size.
  • Graph Maker Journal-ready graphs with error bars and letters.

Updated December 2, 2026