I am working on a project which we have two groups of people; normal vs obese. I have a data set like the following sample:
Subject group time Cholesterol 1 normal 1 12 1 normal 2 14 1 normal 3 15 2 normal 1 16 2 normal 2 18 2 normal 3 19 3 obese 1 15 3 obese 2 19 3 obese 3 19
I think the model is like the mixed model. But I was wondering which variable is the fixed effect and which one random effect? I would like
- To find any difference between normal and obese at each time point.
- To comapre Cholesterol at each time point with Time=$1$ inside of each group to see whether there is a difference or not.
Any advice would be highly appreciated. I want to use R, I am not sure whether this function is a right one for this analysis:
lm <- lme(Cholesterol~time*group, (1|Subject), data=Data)
Is it the right function to use? Should I include time*group in the model or just time+group would be enough? Also how I can compare each time with the baseline within each group?