I would like to understand how to analyse a basic crossover trial using a linear mixed model.

Participants have a baseline measure of the dependent variable, they are then randomised to either placebo or drug, and after the end of the first treatment period have the dependent variable measured again, before switching to the alternative arm and have the dependent variable measured for a final time at the end of the second treatment period. For now let us say we can safely ignore any carryover effects.

My question relates to how one tests whether the drug causes a greater change in the dependent variable compared to the placebo.

I will illustrate with some R code:


# make some data
id <- factor(rep(c(1:100), each=3))
time <- rep(c(1,2,3), times=100)
drug_alloc <- c(rep(c('baseline','placebo', 'drug'), times=50),rep(c('baseline','drug', 'placebo'), times=50))
order <- c(rep(c(1), times=150), rep(c(2), times=150))
bl = rnorm(50)
f1 = bl+rnorm(50)
bl_ = rnorm(50)
f1_ = bl_+rnorm(50)+0.5
outcome <- c(rbind(bl,f1,f2),rbind(bl_, f1_, f2_))
data <- data.frame(id,time,drug_alloc,order,outcome)

# models of interest
m1 <- lmer(outcome ~ drug_alloc +  order*time+ (1 | id), data = data)
m2 <- lmer(outcome ~   order*time + (1 | id), data = data)

#null model
m3 <- lmer(outcome ~ order+time + (1 | id), data = data)

#test signficance

My feeling is that m2 is the model I want to be testing - but I am not sure if either of the models are correct, or if the null model is. Furthermore i'm not sure there is a benefit in including the baseline reading - i seem to have greater power if I exclude those values. Any input appreciated




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.