Skip to main content

5.3) Fitting A Linear Model


Use the data frame GRASS that you created from the file "r_data" (Appendix; Session 2).

  • Investigate the relationships that might be used to predict the biomass of grass plants. Start by plotting the data – e.g. plot(GRASS).
  • To run a multiple regression of biomass against length of leaf blades and number of tillers in the GRASS data frame, type something like

GRASS.lm <- lm(Dms ~ Blade + Tlrs, data=GRASS)

When you’ve done this, the first thing to do is to get residual plots to see whether the assumptions of ordinary linear modeling have been met. First use par(mfrow=c(2,2)) to divide a graphics window into two rows and two columns and then plot(GRASS.lm) to see the standardised residual plots.