1. Learn
  2. /
  3. Courses
  4. /
  5. Helsinki Open Data Science

Connected

Exercise

Holding on to independence: The Linear model

Continuing to ignore the repeated-measures structure of the data, we will fit a multiple linear regression model with weight as response and Time and Group as explanatory variables.

Recall again from Chapter 1: Multiple regression that this is done by defining 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.

Instructions

100 XP
  • Create a regression model with Weight as the response variable and Time and Group as explanatory variables
  • Print out the summary of the model
  • Observe 1) How Group2 and Group3 differ from Group1 conditional on Time and 2) The significance of the regression on Time