I am analyzing data for a repeated measures study with missing data. For example here is a 3 X 3 experimental design with three conditions and 3-time measures:
I am using a mixed model for the main effects:
model1 <- lme(outcomeMeasure ~ condition * time, random = ~1|subject/condition/time, data = exampleData)
anova(model1)
numDF denDF F-value p-value
(Intercept) 1 57 892.3397 <.0001
condition 2 21 1.6985 0.2066
time 2 57 4.5983 0.0363
condition:time 2 36 0.1513 0.8601
Since time is significant, I would like to follow up with a paired test by averaging across condition to obtain values of each subject's time. As you can see in the example data above, subject 1 is missing an entire condition. When I aggregate the data across time:
timeSubjectMeans <- aggregate(value ~ Subject * time, data = exampleData, FUN = mean)
In order to perform a paired t-test on this data, should I exclude subject 1 because they are missing 1 of the conditions?
random = ~1|subject/condition/time
means? $\endgroup$subject/condition/time
means each obs has its own random effect? if it is true, you specified they are independent. If you userandom = ~1|subject
, it specifies that 9 obs from the same subject are correlated with the same correlation coefficient. The obs from different subjects are independent. It it is what you want, it is correct. $\endgroup$