General linear models

This page describes linear models, broadly speaking. In particular, we focus on analyses involving more than one explanatory variable. (For General-ized Linear Models see later page on GLMs).

 
General linear models provide a flexible modeling framework for testing for effects of both continuous and categorical predictor variables on a continuous re...
 

What is a general linear model?

A general linear model is a flexible modeling framework for testing the effects of any combination of categorical and continuous predictor variables on a continuous response measure. The approach includes regression, ANOVA, t-tests and ANCOVA as special cases. The general linear model framework also serves as a starting point for expanding into more complex statistical models.

As with any statistical test, general linear models have assumptions that must be met in order for our inferences to be appropriate.
 

Assumptions of general linear models

As with other statistical tests, general linear models have certain assumptions that must be satisfied if our inferences are going to be correct.

Statistical interactions allow us to test whether effects are constant or whether they depend on other predictors in the model. General linear models are qui...
 

Interactions

General linear models allow us to test whether the effects of predictors on a response variable are constant or whether these effects depend on the value of some other predictor. Linear models allow for any combination of interactions between categorical and continuous predictors.

For a case study including a hypothesis involving a statistical interaction, see the painted turtle nesting example.

 

Non-linear relationships

General linear models assume that predictors are related to the response variable in a linear way, but in many cases biological relationships are non-linear. Luckily we can linearise non-linear relationships using transformations, quadratic terms or breakpoints.

Additional Resources


StatsTree General Linear Model Primer

StatsTree General Linear Models in R

StatsTree - Ratios as Response Variables

Whitlock & Schluter - The Analysis of Biological Data

Chapter 18: pages 609-628 [Sapling]

 

Multiple linear regression in R

Advanced: Code tutorial video for conducting a multiple linear regression in R.

Multiple linear regression

Intermediate: What if you have more than one independent variable? In this video we review the very basics of Multiple Regression.

 

Analysis of covariance: ANCOVA

Intermediate: Explanation and example of ANCOVA, another test that falls under the umbrella term of “General Linear Models”.


Review Questions

 
  1. Give three reasons that studies in biology sometimes have more than one explanatory variable. [Credit: Whitlock and Schluter, 2009]

  2. Write an “R formula” for a linear model with two independent variables and one dependent variable- dog breed, brand of dog food, and the dog’s lifespan, respectively-, and include an interaction effect between the two dependent variables.

  3. Which of the following methods could be categorized under “general linear models”?

    Binomial test

    Goodness-of-fit test

    Chi-squared test for independence

    t-test

    ANOVA

    Regression

    Multiple linear regression

  4. When an interaction between two (or more) factors is present, what conclusions would you draw about the factors?

The Next Steps


Confused?

Let’s move down the tree and review these concepts.

Ready to Move Forward?

Let’s move up the tree to the next topic.