Choose the simplest analysis that answers your scientific question. It usually doesn’t need to be complicated. Then:
- Justify the choices that affect the result.
- Quantify its uncertainty, and check it against independent evidence where you can.
- Explain what it means physically.
This page covers the statistics. How well you know each measured value is covered in Error and uncertainty analysis. Most results need both, because neither stands in for the other:
- A tight confidence interval won’t reveal a calibration offset shared by every point.
- Small error bars don’t make a difference significant.
Methods in the field change quickly and every project is different, so treat the methods here as starting points. If a newer method is more appropriate for your question, use it and share what you learn. The requirements stay fixed.
The requirements
Every analysis meets the ones that apply to it.
- Write down your analysis plan before you collect data, so your test answers your question rather than a pattern you happened to spot. (Plan)
- The model counts independent repeats (trials, birds, specimens), not data points, so results don’t look more certain than they are. (Plan)
- The model accounts for linked measurements, such as repeated trials on one bird or related species, because they tend to resemble each other. (Plan)
- Check how well the model fits, and save that check with your code so anyone can rerun it. (Check)
- Report every test, significant or not, with its estimate and 95% interval. The size of an effect usually matters most, and null results count. (Report)
- Report enough for someone to rerun the analysis, and share the data and code when the paper is published. (Report)
- Report measurement uncertainty separately from the statistical results, because they answer different questions. (Report)
Some situations add to this list: many comparisons, large measurement uncertainty, or very few samples. See Situation-dependent checks.
Plan before you collect
None of this needs to be elaborate. A few clear, thoughtful sentences now will save weeks later.
- Decide what to quantify. Turn each prediction from your
hypothesis into a quantity you can
measure and compare.
- If you expect a vortex to be “more developed”, name the measure that would show it, what you will compare it with, and how large a difference would matter physically.
- If you expect no difference, decide how similar counts as the same.
- Settle this before choosing a model. A correct model cannot rescue a vague comparison.
- Write a short plan and save it in the project repository before the first trial or simulation
run.
- Say what you will measure, what you will compare, and what result would support or count against each hypothesis.
- One rough paragraph is enough. Plans often change once data arrive; just note what changed and why.
- Writing it first protects you from trying analyses until something looks significant (p-hacking).
- Name what counts as one repeat in your plan, and what the results apply to.
- One hawk with ten trials sampled 4000 times each is ten repeats, and the results apply to that hawk.
- Check: the model’s reported degrees of freedom should be near your number of repeats, not your number of data points.
- Treating data points as repeats is pseudoreplication (Hurlbert 1984; Lazic 2010).
- Account for linked measurements. Common starting points:
- Repeated trials on one bird: give each trial its own baseline (a random intercept for trial).
- Repeated configurations of one specimen: the same, for the specimen.
- Several species: include their family tree (the phylogeny).
- Then check for links the model missed, such as samples close in time that resemble each other.
For help setting up these models, see Harrison et al. (2018). If one won’t fit or gives warnings, see Bolker’s FAQ on generalised linear mixed models (GLMMs).
Explore before you fit
- Clean the data with code and leave the raw files untouched (Data management).
- Make lots of quick, rough plots, working through the eight checks of Zuur, Ieno & Elphick (2010).
- Use plots for these checks. With thousands of samples, a formal test flags almost everything.
The eight exploration checks
Formulate the hypothesis · run the experiment · collect the data
Data exploration
- Outliers in Y and Xboxplot · Cleveland dotplot
- Homogeneity of Yconditional boxplot
- Normality of Yhistogram · Q–Q plot
- Zero trouble in Yfrequency plot · corrgram
- Collinearity in XVIF · scatterplots · PCA
- Relationships between Y and Xmulti-panel scatterplots
- Interactionscoplots · conditional boxplots
- Independence of YACF · variogram · Y against time or space
Apply the statistical model
Exploring can shape how you model the data, but your plan sets what you test.
- What you see can guide choices such as a transformation, or which measurements are linked.
- It can also raise new questions worth following.
- If you test something you only noticed after seeing the data, call it exploratory. Presenting it as planned (called HARKing, Hypothesizing After the Results are Known) overstates the evidence.
Choose a model
Start simple. The simplest model that fits your design is usually enough, and you can add to it if the checks show you need to. Your plan should say why the model answers your question.
Starting models for common kinds of data
| Your data | Start with | Where it is explained |
|---|---|---|
| One value per condition, conditions independent | lm() |
Schluter, Fit model → Simple linear regression |
| Repeated measurements on the same bird, specimen or model | lmer(y ~ x + (1 \| ID)) |
Schluter, Fit model → Mixed models; Coding Club |
| Several individuals, generalising to the species | lmer(), individual as random intercept |
Harrison et al. 2018 |
| Multiple species | gls(..., correlation = corPagel()), or PGLMM in MCMCglmm |
Schluter, Phylogenetic comparison; Hadfield’s course notes |
| Counts, proportions, binary outcomes | glmer() or glmmTMB() |
Bolker’s GLMM FAQ |
| Competing functional forms (e.g. linear vs quadratic) | Fit each, compare by Akaike information criterion (AIC) | Harrison et al. 2018, multi-model inference |
| Real uncertainty on both axes | Major-axis or standardised major-axis regression (smatr) |
Schluter, Fit model → Correct for body size |
| A deterministic sweep with no sampling noise | No test. Run a sensitivity study instead | Harvey 2024 |
| Many correlated shape or morphology variables, no single response | PCA | Schluter, Multivariate methods |
If you compare models, keep the set small, with each model answering a hypothesis you can state. Fifty combinations ranked by AIC will find patterns in noise.
Check the fit
- Plot the residuals (what is left after the model’s prediction) and look for patterns.
DHARMaworks for most models. - Save the code and plots with your analysis, so anyone can rerun the check when the data change.
- Check that the conclusion still holds under other reasonable choices, such as how you handle outliers or set up the model, and report how much it changes (Writing papers).
Report
- Lead with the size of the effect and its 95% interval. A \(p\)-value only tells you how surprising your data would be if there were no effect, not how big the effect is (Wasserstein, Schirm & Lazar 2019; Amrhein, Greenland & McShane 2019).
- Report every planned test, whatever its \(p\)-value. Our field’s default is \(\alpha = 0.05\), two-sided.
- Treat null results as results. If the interval is narrow, a non-significant result shows any effect is small, and that deserves the same care as a positive result. If it is wide, say the data can’t tell yet rather than “no effect”.
- Discuss results by how big and how certain they are, and what they mean for your question.
- Say what the result means physically and how it compares with independent evidence. Writing papers covers the wording.
- Keep measurement uncertainty separate. It goes in the error bars and text, following Error and uncertainty analysis. Statistical uncertainty goes in the confidence intervals. Figures covers labelling which is which.
- Share the data and analysis code when the paper is published, following Data management.
Include enough for someone to rerun the analysis:
| Item | Example |
|---|---|
| Model formula, random terms included | lift ~ condition + (1 \| trial) |
| What counts as one repeat, in words | “1 hawk, 5 trials per condition, ~4000 samples per trial” |
| Software and package versions | R 4.4.1; lmerTest 3.1-3 |
| Estimation and degrees-of-freedom method | Restricted maximum likelihood (REML), Kenward–Roger |
| Test statistic, degrees of freedom and exact \(p\) | \(F_{1,17.06} = 13.28\), \(p = 0.002\) (“\(p < 0.001\)” only below that) |
| Estimate with a 95% interval | \(-0.14\) [\(-0.21\), \(-0.07\)] |
| Effect size and model fit, where meaningful | partial \(\eta^2 = 0.51\); marginal and conditional \(R^2\) |
| Seed, for anything resampled | set.seed(42) |
Situation-dependent checks
Not every project needs these. If one fits your situation, it becomes part of your analysis. Some are harder than others, so look for them while you plan and talk them through with Christina. Open the ones that apply to you.
When you fit many models or test many responses
- Some will look significant by chance.
- Choose one main measurement in advance, correct for multiple comparisons, or label the rest exploratory.
- Say which you did.
When measurement uncertainty is large relative to the effect
- Rerun the analysis many times with each point shifted at random within its uncertainty, and check the conclusion holds (method in Error and uncertainty analysis).
- Harvey et al. (2022) used 5,000 reruns across the centre-of-gravity error range.
When you have one or two animals or specimens
- Significant results from small samples tend to overstate the effect, because only large estimates reach significance.
- Report the smallest effect your design could have detected. You can simulate this with
simr, using the variability from pilot data and the smallest effect that would matter physically. - Schluter’s Planning tools page covers simpler cases.
When your question compares conditions
- Report the difference itself, in the original units, with its interval.
emmeansandmarginaleffectsdo this, and correct for multiple comparisons.
When the model has several predictors
- Plot what the model predicts as well as the raw data.
visregshows the effect of one predictor with the others held fixed, and works withlmerfits.
When you have many correlated variables and no single response (PCA)
Principal component analysis (PCA) suits data such as a wing outline described by fifty correlated coordinates. Schluter’s Multivariate methods page covers the mechanics.
- Scale first. If variables have different units, use
scale. = TRUEso no single variable dominates. Align landmark coordinates first withgeomorph::gpagen(), so position and size don’t become the first components. - Decide in advance how many components to keep.
- Interpret by drawing the shape at each end of a component. Two outlines show what it means more clearly than a table of numbers.
- Treat components as specific to your sample. They shift when specimens are added. Scores used in later models are estimates, so say so in the methods.
- A small percentage can still matter. In Gamble et al. (2020), PC2 explained only 0.3% of trailing-edge shape change, yet captured a real angle-of-attack effect.
- Signs are arbitrary. State which shape each positive direction represents, and keep it the same across every figure.
- Report the number of variables and specimens, the scaling and alignment, the variance explained by each component you kept, how you chose how many to keep, and the sign convention.
- For motion over time, note that PCA ignores time. Dynamic mode decomposition (DMD) finds patterns that each carry a frequency and growth rate; Lydia France’s BirdDMD is the place to start. If you use it, check how well it reproduces data it wasn’t fitted to.
When you have only two or three replicates
- A Bayesian fit is an option: see the
brmstutorial or theMCMCglmmtutorial. - With so little data, your prior assumptions strongly shape the result. Choose them before you see the data, and report how much the conclusion depends on them.
Where to learn more
- Everything on this page: Schluter’s pages, plus the worked R for every example in The Analysis of Biological Data.
- Phylogenetic comparative methods: Revell & Harmon (2022), Phylogenetic Comparative Methods
in R, and
phytools2.0. - PCA in depth: Jolliffe & Cadima (2016).
Spot something to improve? Anyone in the lab can edit this guide. Edit this page suggest a change how edits work