############################################## # Analysis of Longitudinal Data (SuSe 2017) # # # # Code to use for tutorial 4 # # Datum: 20.06.2017 # ############################################## ############## # Exercise 3 # ############## ## 1e) # load rats data library(nlme) load("rats.long.RData") str(rats.long) # Transformation of TIME: rats.long$logT <- log(1+(rats.long$TIME-45)/10) # take out NAs rats.long <- rats.long[complete.cases(rats.long),] # fit linear model lm1 <- lm(RESPONSE ~ GROUP * logT - GROUP, data = rats.long)