O'Reilly logo

Beginning R: The Statistical Programming Language by Mark Gardener

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10

Regression (Linear Modeling)

What You Will Learn In This Chapter:

  • How to carry out linear regression (including multiple regression)
  • How to carry out curvilinear regression using logarithmic and polynomials as examples
  • How to build a regression model using both forward and backward stepwise processes
  • How to plot regression models
  • How to add lines of best-fit to regression plots
  • How to determine confidence intervals for regression models
  • How to plot confidence intervals
  • How to draw diagnostic plots

Linear modeling is a widely used analytical method. In a general sense, it involves a response variable and one or more predictor variables. The technique uses a mathematical relationship between the response and predictor variables. You might, for example, have data on the abundance of an organism (the response variable) and details about various habitat variables (predictor variables). Linear modeling, or multiple regression as it is also known, can show you which of the habitat variables are most important, and also which are statistically significant. Linear regression is quite similar to the analysis of variance (ANOVA) that you learned about earlier. The main difference is that in ANOVA, the predictor variables are discrete (that is, they have different levels), whereas in regression they are continuous.

Although this is not a book about statistical analysis, the techniques of regression are so important that you should know how to carry them out. The lm() command is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required