# Paired t-test following main effect of mixed model with missing data

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?

• For the random effect part, do you know what random = ~1|subject/condition/time means? Nov 27 '18 at 21:31
• This defines the multilevel structure of the model's random factor subject. Within each subject are the levels of condition, and within each condition are the levels of time. Nov 27 '18 at 22:02
• We use the random effect to incorporate the correlation duo to the repeated measures. I am afraid your random specification specifies the independent among response variables. Nov 27 '18 at 22:06
• Thank you for the response. Are you saying condition and time should not be in the random effect of the model? I've seen models that are just a random intercept for the subject: random = ~1|subject. Nov 27 '18 at 22:15
• subject/condition/time means each obs has its own random effect? if it is true, you specified they are independent. If you use random = ~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. Nov 27 '18 at 22:42