Linear models in Agriculture and Natural Resources
2025-01-12
1 Preface
This is a book written in Markdown for ALS6502C at the University of Florida, instructed by Dr. Phil Hahn (hahnp@ufl.edu). This is Version 1.0 and will be updated periodically.
This book is meant to be used in conjunction with the class lectures and is not meant to replace lectures. With that being said, this book is written to be semi-standalone and to provide students to review the material. Please visit to course canvas page for syllabus and additional materials.
1.1 Learning outcomes:
By the end of the course, students will be able to:
Propose biological questions and formulate hypotheses to test them.
Construct statistical models that are commonly used in agricultural and natural resource studies, including linear models, generalized linear models, linear mixed models, and generalized linear mixed effects models, using freely available packages in R.
Analyze, visualize, interpret, and report the results of statistical models using formats acceptable for publication.
Critique results of analyses reported by peers and in the literature.
Select R documentation and use new R packages and functions.
1.2 Overview of statistical analysis workflow
Below is the general workflow we will use for our analyses, starting with things that need to be done before data is collected (pre-analysis) and then for the analysis stage. In future versions of the book, this will be fleshed out into a chapter. Another great source is Zuur and Ieno 2016.
1.2.1 Workflow pre-analysis
- What is your question of interest? Hypothesis?
- Pick an approach (observational, experiment, model)
- What data (and covariates) to collect?
- Carefully plan your analysis ahead of time
- Focus on testing your hypothesis
- Data wrangling
1.2.2 Workflow for analysis
Data exploration
Construct a statistical model to test your hypothesis
- Response variable - which distribution?
- Fixed effects and potential interactions
- Random effects
- Check model assumptions
- Residuals
- Overdispserion or zero-inflation (if applicable)
- Check random effects and/or distribution using AIC or LRT
- Be cautious with this step
- Usually random effects and distributions should be selected a priori based on the study design and type of data collect
Examine significance of terms in model
Examine parameter estimates
- emmeans and/or emtrend
- Construct contrasts
- also emmeans/emmtrends
Calculate R2m and R2c
Make pretty figure