6.4 Other modelling approaches

As with most things R related, a complete description of the variety and flexibility of different statistical analyses you can perform is beyond the scope of this introductory text. Further information can be found in any of the excellent documents referred to in Chapter 2. A table of some of the more common statistical functions is given below to get you started.

 

R function Use
glm() Fit a generalised linear model with a specific error structure specified using the family = argument (Poisson, binomial, gamma)
gam() Fit a generalised additive model. The R package mgcv must be loaded
lme() & nlme() Fit linear and non-linear mixed effects models. The R package nlme must be loaded
lmer() Fit linear and generalised linear and non-linear mixed effects models.
The package lme4 must be installed and loaded
gls() Fit generalised least squares models. The R package nlme must be loaded
kruskal.test() Performs a Kruskal-Wallis rank sum test
friedman.test() Performs a Friedman’s test