Skip to content
Prev 12026 / 20628 Next

Reformat: Assistance with specification of crossover design model

Thanks very much for your thoughts, Ben. I've added some additional thoughts below
that I hope you'll correct me on. ?

Best,
Adam

----------------------------------------
On further thought, I think the carryover effects should be modeled
explicitly. In fact, we can distinguish between two types of carryover
effects - so-called 'self' (treatment follows itself) and 'mixed'?
(treatment follows a different treatment) carryover effects. ?A common?
model to analyze in this?case is:

Ydks = mu + Ak + Td(k,s) + I*Sd(k-1, s) + (1-I)*Md(k-1, s) + Us + eks

where:

Ydks = response to treatment d in period k for subject s
Ak = effect of period
Td = effect of treatment
I = indicator if treatment in period k-1 was the same as in period k
Sd = Self carryover effect of treatment d
Md = Mixed carryover effect of treatment d
? ?(NOTE: no carryover effect in period 1; i.e., Sd and Md = 0 in period 1)
? ?(I'm not sure how to distinguish this from treatment "0"; currently in?
? ? period 1, I've set Sd = Md = NA, but this is incorrect b/c it drops from
? ? consideration the observations from period 1)
Us = subject effect (random)
eks = error term

The corresponding LMM is specified, I think, as follows:

datURL <- "https://www.dropbox.com/s/qyer7qrl1ay2h22/xover_test.csv"

# Download data
dat <- repmis::source_data(datURL, sep = ",", header = TRUE)
dat <- within(dat, {
? ? ? ? ? ? ? id = factor(id)
? ? ? ? ? ? ? period = factor(period)
? ? ? ? ? ? ? cov1 = factor(cov1)
? ? ? ? ? ? ? cov2 = factor(cov2)
? ? ? ? ? ? ? selfco = factor(self * prevtrt)
? ? ? ? ? ? ? mixedco = factor((1-self) * prevtrt)
? ? ? ? ? ? ? trt = factor(trt)
? ? ? ? ? ? ? })
str(dat)


# Proposed linear mixed model analysis
require(lme4)
mod1 <- lmer(y ~ trt + period + selfco + mixedco + cov1 + cov2 +?
? ? ? ? ? ? ? ? (1|id), data = dat)
summary(mod1)

I tried including the baseline measurement (y0) as you suggested, but it?
reduced the variance estimate of (1|id) to zero. ?I'm inclined, then, to?
drop the baseline measurement and leave the random intercept for individuals. ?
In fact, the variance is very near zero even when excluding y0.?
I'm still unsure about the trt*period interaction. ?It will eat several degrees of
freedom as a fixed effect. ?Including it as a random effect (1|trt:period) produces
an estimate of zero variance. ?What is my interpretation if treating it as a random
effect?