QCBS R Workshop Series
Preface
0.1
Code of conduct
0.1.1
Expected behaviour
0.1.2
Unacceptable behaviour
0.2
Contributors
0.3
Contributing
Linear models in
R
1
Learning objectives
2
Preparing for the workshop
3
The linear model
3.1
What is a linear model?
3.1.1
Example: Abundance and mass of bird species
3.2
Formulation of a linear model
3.3
Evaluation of the linear model
3.4
Assumptions of the linear model
3.4.1
Normal distribution of the residuals
3.4.2
Homoscedasticity
3.4.3
Independence of the residuals
3.5
Notation for linear models
3.5.1
Mathematical notation
3.5.2
R notation
3.6
Fitting a linear model
3.6.1
Model estimation
3.7
Learning objectives
4
Linear regression in R
4.1
Model formulation
4.1.1
Model equation
4.2
Linear regression in R
4.2.1
Step 1: Formulate and run a linear model
4.2.2
Step 2: Verify assumptions using diagnostic plots of the residuals
4.2.3
Step 2
. Verify assumptions of
lm1
4.2.4
Assumptions not met - what is wrong?
4.2.5
Assumptions not met - how to proceed?
4.2.6
Step 3.
Analyze parameter estimates
4.3
Model interpretation
4.3.1
Finding a better model: terrestrial birds
4.4
Challenge 2
4.4.1
Solutions
4.5
Linear regression in R
4.6
Variable names
5
t-test and ANOVA
5.1
Analysis of Variance (ANOVA)
5.1.1
Types of ANOVA
5.1.2
T-test
5.1.3
Running an ANOVA
5.1.4
Verifying assumptions
5.1.5
Model output
5.1.6
Complementary test
5.1.7
Plotting
5.1.8
Going further: Contrasts
5.2
Two-way ANOVA
5.2.1
4.1 Running a two-way ANOVA
5.2.2
4.2 Interaction plot
5.3
Unbalanced ANOVA (advanced section/ optional)
6
Analysis of covariance (ANCOVA)
6.0.1
6.1 Assumptions
6.0.2
6.2 Types of ANCOVA
6.0.3
6.3 Running an ANCOVA
7
Multiple linear regression
7.0.1
Model formulation
7.1
Assumptions
7.1.1
If variables are collinear
7.2
Multiple linear regression in R
7.2.1
The data
7.2.2
Verify assumptions
7.2.3
Linear regression
7.2.4
Find the best-fit model
7.3
Polynomial regression (additional material)
7.4
Variation Partitioning (additional material)
Final considerations
8
Summary
9
Additional resources
10
References
QCBS R Workshop Series
Workshop 4: Linear models
Chapter 10
References