Generalized Linear Mixed Model - Intro
This note is largely based on the textbook "Mixed Effects Models and Extensions in Ecology with R" by Alain Zuur, Elena N. Ieno, Neil Walker, Anatoly A. Saveliev, Graham M. Smith (2009)." Available at Helsinki university library
Limitations of linear regression
- In ecology, data is seldom adequately modeled by linear regressions, due to the assumptions inherent to the model:
- normality of residuals
- This is not so important because of the Central Limit Theorem - as long as data is fairly normal it's OK.
- homogeneity of residuals
- Also called "checking for heteroskedasticy"
- If the spread of the data is not the same at each
value, we have a problem. - We check this my plotting residuals vs. fitted and seeing if there is a pattern
- Often in ecology this is a problem - variables correlate with each other and there are discernible patterns in the residuals
- The easiest way to deal with this is a data transformation, or picking a different observation type
- fixed explanatory variables (
) - This assumption is invalid if you knew the values in advanced and biased the results
- For example, choosing your study sites based on your idea of how to get a good sample
- This results in biased regression parameters
- independence
- Violation of independence invalidates important tests like the F-statistic and t-test
- If any
value at is influenced by any other , your data is not idependent. - The easiest way to see this is to plot residuals vs X and looking for pattens in the residuals.
- Your data requires a model improvement or a data transformation
- For example, incorporating a spatial dependence structure (Spatial Dependence)
- normality of residuals
- The textbook gives some examples of linear models that violate these assumptions - they were actually unable to find any real ecological data sets that don't violate any of these assumptions
- Therefore, linear regression is often not the best tool for an ecologist.
Alternatives
Heterogeny can be solved by:
- Allowing for different variances in the linear regression model using generalizedLeast squares estimation (?) (Doesn't a linear model already do this?)
- Using a different distribution or model structure. For example, a Generalized linear models with either:
Dependence
- Requires the use of models that allow for more flexibility than regression, like smoothing methods
- A model for the error structure, like temporal or spatial correlation, or along an age or depth gradient.
- We also need to consider Nested Data and Random Effects
Conclusion
Combining all of the above alternatives with GLM is how you get a Generalized Linear Mixed Model or GLMM.