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.
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.
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.
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 SAS | In R | In this guide and aStat |
|---|---|---|
PROC MEANS, PROC UNIVARIATE | summary(), sd(), shapiro.test() | Descriptive statistics · Normality Test |
PROC TTEST | t.test() | The t-test |
PROC NPAR1WAY | wilcox.test(), kruskal.test() | The t-test |
PROC CORR, PROC REG | cor.test(), lm() | Correlation and regression |
PROC GLM, PROC ANOVA | lm(), anova(), emmeans() | ANOVA (analysis of variance) · ANOVA Calculator |
LSMEANS / ADJUST=TUKEY LINES | emmeans(), pairs(), cld() | Post hoc tests · ANOVA Calculator |
PROC MIXED | lmer() (lme4), gls() (nlme) | Mixed models: fixed and random effects |
PROC MIXED with REPEATED | gls() with corAR1(), corSymm() | Repeated measures and crossover designs |
PROC GLIMMIX, PROC GENMOD | glm(), glmer(), glm.nb() | Generalized linear models |
PROC NLIN | nls() | Dose-response and quadratic regression |
PROC POWER, PROC GLMPOWER | power.t.test(), power.anova.test() | Statistical power and sample size · Plan a study |
PROC PLAN | sample() | Experimental design · Plan a study |
MANOVA statement in PROC GLM | manova() | MANOVA and multivariate analysis |
SAS is a registered trademark of SAS Institute Inc. aStat is independent and not affiliated with SAS Institute.
The chapters
Part 1. The basics
- What is statistics?Populations, samples, variables and types of data
- Descriptive vs inferential statisticsFrom a sample to a conclusion: sampling distributions
- Descriptive statisticsMean, median, mode, range, variance, IQR, skewness
- Standard deviation vs standard errorWhich to report, error bars, formulas
- Coefficient of variation (CV)Formula, and what a good CV is in trials
- Probability distributionsNormal, binomial, Poisson, t, F; z scores; transformations
Part 2. Making inferences
Part 3. Designing an experiment
Part 4. Analyzing your data
- Correlation and regressionPearson, Spearman, linear and multiple regression, R²
- The t-testOne-sample, two-sample, Welch, paired, and rank tests
- ANOVA (analysis of variance)One-way ANOVA, the F test, assumptions, Kruskal-Wallis
- Post hoc testsTukey, LSD, Duncan, Bonferroni, Dunnett: which to use
- Two-way ANOVA and factorial experimentsInteraction, blocks, Latin squares, unbalanced data
Part 5. Beyond the basics
- Mixed models: fixed and random effectsRandom blocks, nesting, split-plots, ANCOVA, BLUP
- Repeated measures and crossover designsData over time, covariance structures
- Dose-response and quadratic regressionFertilizer rates, nutrient levels, optimum dose
- Generalized linear modelsLogistic, Poisson, negative binomial, GLMM
- MANOVA and multivariate analysisSeveral responses at once
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