Skip to content

Reformat: Assistance with specification of crossover design model

7 messages · Adam Smith, Ben Bolker, Sunil Mundra +1 more

#
Apologies for the formatting in the initial post.

Hello list,

I'm analyzing data (variable names in brackets) generated by a 4-period [period], 3-treatment [trt] crossover design.
The design was strongly balanced (all treatments preceded all others, including itself) and uniform within period (all treatments occurred the same # of times in each of the 4 periods).

This produced 18 distinct sequences of treatments (e.g., ABCC, CAAB, etc.), to which a single individual [id] was randomly assigned. Two covariates [cov1, cov2] were also measured on each individual.

The response [y] was continuous, and each individual was associated with a pre-study baseline measure [y0].

Because a single individual was assigned to each sequence, I believe that a random effect for each individual will capture individual, baseline, and sequence effects (they're perfectly confounded).

The question is simple: does the response differ among treatments?

I'm hoping the correct specification is as simple as I think it is, illustrated below with mock data.
My specific questions:

1 - Does this model correctly capture treatment, period, and potential carryover effects? As I understand it, in a strongly balanced design such as this, carryover and treatment effects are not confounded, so my assumption is that I don't have to specify any addition variable to capture this effect (e.g., a variable indicating the treatment in the preceding period). I'm happy to be corrected.

2 - Is an interaction between treatment and period prescribed? Because the design is uniform within periods, I believe that period and treatment effects are likewise not confounded.

3 - Does the random effect for each individual captures variation due to individual, sequence, and baseline measurement?

Thanks very much for your assistance,

Adam Smith
Department of Natural Resources Science
University of Rhode Island

# Download data
datURL <- "https://dl.dropboxusercontent.com/u/23278690/xover_test.csv"
dat <- repmis::source_data(datURL, sep = ",", header = TRUE)
dat <- within(dat, {
? ? ?id = factor(id)
? ? ?trt = factor(trt)
? ? ?period = factor(period)
? ? ?cov1 = factor(cov1)
? ? ?cov2 = factor(cov2)
})

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

# Test global treatment effect, for example...
mod2 <- update(mod1, . ~ . - trt)
anova(mod1, mod2)

sessionInfo()

R version 3.0.3 (2014-03-06)

Platform: x86_64-w64-mingw32/x64 (64-bit)

attached base packages:[1] stats graphics grDevices utils datasets methods base 

other attached packages:[1] car_2.0-19 AICcmodavg_1.35 lme4_1.1-5 Rcpp_0.11.1 Matrix_1.1-3 plyr_1.8.1
#
Adam Smith <raptorbio at ...> writes:
with a pre-study baseline measure [y0].
Thanks for a very clear question.  I'm going to take a stab at
these, but haven't thought *very* deeply about them; hopefully
this will inspire corrections/alternative answers.
I think you're right that the individual-level random effect
controls for pre-treatment and sequence/carryover effects.  However,
I'm not sure it will capture period or treatment-by-period effects
(i.e. residuals within the same period might be correlated, and
residuals from individuals who received the treatment in the same
period might be correlated).

  One way to see whether you might have missed something would
be to draw (e.g.) boxplots of residuals by whatever groupings
you might be concerned about.
I think so.
I think so.
I think you do want trt*period (possibly as a random effect?)
  In a setting where I had access to some regularization (e.g.
blme) I would be tempted to treat period as random -- but I wouldn't
do it in this vanilla model, because there aren't enough periods to
estimate it reliably.

  While you don't _need_ to incorporate pre-treatment covariate,
carryover effects, etc., it might be interesting -- I think these
would be partitioned out of the among-individual variation ...
methods base
#
On 14-06-07 04:29 PM, Sunil Mundra wrote:
This means that you don't have all 36 combinations of Treatment,
Round, and Depth in your experimental design (based on the arithmetic it
seems that "Round" is your 9 samples).  (You probably only have 28
combinations -- were some treatment/depth combinations missed in some
rounds?)  If you use a recent version of lme4 you should be able to ask
lme4 to drop the aliased/unidentifiable columns -- in fact this should
happen automatically.

  However, you have more problems than this (sorry)

 * you're probably not going to be able to fit block as a random effect
(because there are only two levels)
 * you shouldn't have the same factor included as both a random and a
fixed effect

 I would suggest (I think)

Richness ~ Treatment*Depth + (1|(Block:Fence)/Round)

 possibly

 Richness ~ Treatment*Depth + (Treatment*Depth|(Block:Fence)) +
(1|Block:Fence:Round)

 to allow for variation in treatment/depth effects across blocks and
block/fence combinations
#
On Sun, Jun 08, 2014 at 01:59:07AM +0530, Sunil Mundra wrote:
You don't need to specify wether your data is nested or crossed, lme4
will figure out that anyway. If you want random intercepts try:

Z1 <- lmer(Richness ~ Treatment*Round*Depth + (1|Block) + (1|Fence) + (1|Treatment) + (1|Round), REML= FALSE, data = data)

If you want random slopes, I think you need to explain what you want
better.
#
On Sun, Jun 08, 2014 at 10:08:58PM +0200, Hans Ekbrand wrote:
[...]
When reading Ben Bolkers suggestion, I realised that my suggestion
was not useful, please forget about it.
#
On 14-06-08 04:08 PM, Hans Ekbrand wrote:
Minor correction here: lme4 can *only* figure out whether the grouping
variables are nested if they are uniquely labeled (e.g. fences within
block are labeled b1f1, b1f2, b1f3, b2f1, b2f2, b2f3, ... rather than
f1, f2, f3, f1, f2, f3 ...