Linear Mixed Effects Models: Gather 'round
Again, to be able to study the diffecences between the variable of interest, that is the weight of the individual rats, and the groups as well as the change of the weight in time, we want to gather the data to a long form.
This time we need to extract the number of days as an integer variable.
Este ejercicio forma parte del curso
Helsinki Open Data Science
Instrucciones del ejercicio
- Assign
keyasWDand value asWeightand convert the data to a long form - Mutate a new variable
Timeby extracting the number of the day fromWD glimpse()the data
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# dplyr, tidyr and RATS are available
# Convert data to long form
RATSL <- RATS %>%
gather(key = "Change me!", value = "Change me!", -ID, -Group) %>%
mutate(Time = as.integer(substr("Change me!")))
# Glimpse the data
glimpse(RATSL)