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.
Este ejercicio forma parte del curso
Helsinki Open Data Science
Instrucciones del ejercicio
- Create a regression model with
Weightas the response variable andTimeandGroupas explanatory variables - Print out the summary of the model
- Observe 1) How Group2 and Group3 differ from Group1
conditional on
Timeand 2) The significance of the regression onTime
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# dplyr, tidyr, RATS and RATSL are available
# create a regression model RATS_reg
RATS_reg <- "Regression model here!"
# print out a summary of the model