# Cluster-randomized trial: mixed model hypothesis testing

I want to estimate the effect of randomly assigned intervention. The outcome is measured at the individual level, but the individuals are assigned to groups which influence eachother a lot, and it is the groups which are assigned to treatment or control.

I need to test the null hypothesis that the intervention had no effect.

I think this is a case where I want to estimate random effects at the group level and a fixed effect for the treatment (I've used lmer before), but I'm not totally sure, and even if that's right, I'm not sure how to take the next step from there to test the null I want to test.

The following lmer model would seem appropriate:

fit = lmer(
formula = outcome ~ (1|group) + treatment
, data = myData
)


This presumes that you're measuring each individual once only. In this case, you treat observations from individuals as having a Gaussian random deviation from their group mean, and the group means are in turn influenced by an effect of treatment.

• Thanks, but I'm stuck at trying to test the hypothesis but no p-values come out of the lmer output. – SE_groupie Sep 17 '14 at 2:15
• How about a confidence interval? confint(fit,method='Wald') – Mike Lawrence Sep 18 '14 at 11:16
• you could also try the package `nlme' which has very similar syntax to lmer. Or you could use the package 'lmerTest' which is a wrapper for lmer that gives p-values. – llewmills Sep 27 '16 at 6:41