1. Belajar
  2. /
  3. Kursus
  4. /
  5. Helsinki Open Data Science

Connected

Latihan

Multiple regression

When there are more than one explanatory variables in the linear model, it is called multiple regression. In R, it is easy to include more than one explanatory variables in your linear model. This is done by simply defining more explanatory variables with the formula argument of lm(), as below

y ~ x1 + x2 + ..

Here y is again the target variable and x1, x2, .. are the explanatory variables.

Instruksi

100 XP
  • Draw a plot matrix of the learning2014 data with ggpairs()
  • Fit a regression model where points is the target variable and both attitude and stra are the explanatory variables.
  • Print out a summary of the model.
  • Adjust the code: Add one more explanatory variable to the model. Based on the plot matrix, choose the variable with the third highest (absolute) correlation with the target variable and use that as the third variable.
  • Print out a summary of the new model.