[R-sig-ME] Varying slopes in a multilevel model with a between subjects treatment
Derek Dunfield
dunfield at mit.edu
Wed Nov 30 18:16:09 CET 2011
Dear all:
I am currently working with a multilevel model with ITEMS (and
covariate V1) nested within SUBJECT. Items were not repeated across
subjects (each item looked at was novel). SUBJECTS were given a
treatment (V2) in a between subject design. The dependent variable
(DV) is per ITEM. I've included a dummy data set with a similar design
below.
I am interested in V1 and V2 as predictors, as well as the potential
interaction of V1:V2. In addition, I expect varying intercepts and
varying slopes for V1 within each SUBJECT.
I believe this would correspond to the model:
model1 <- glmer(DV ~ V1*V2 + (0 + V1|SUBJECT) +
(1|SUBJECT),testdataset,family="binomial")
However, I also expect V1 to have varying intercepts and slopes with
respect to V2. I believe varying intercepts should be accounted for by
(1|SUBJECT) because of the between subjects treatment design.
Similarly, I don't believe (0 + V2|SUBJECT) would make sense, since
each subject only has one value of V2.
Instead, I ran a model accounting for varying slopes of the
interaction V2:V1. This seemed to make sense since each V2:V1 factor
should have a different slope if V1 slopes vary with respect to V2.
This gives us the model:
model2 <- glmer(DV ~ V1*V2 + (0 + V2:V1|SUBJECT) +
(1|SUBJECT),testdataset,family="binomial")
Model2 does give me different results than model1. However, because of
the between subjects design for V2 treatment, I'm not clear why model2
is any different from model1. Shouldn't V2:V1 should be 0 for the
non-treated value of V2 within a subject?
Many thanks for help interpreting this question / design.
Yours,
Derek
TESTDATASET:
SUBJECT V2 ITEM V1 V1.nested DV
S1 A 1 a A:a N
S1 A 2 a A:a N
S1 A 3 a A:a N
S1 A 4 a A:a Y
S1 A 5 a A:a Y
S1 A 6 b A:b Y
S1 A 7 b A:b Y
S1 A 8 b A:b Y
S1 A 9 b A:b Y
S1 A 10 b A:b N
S2 A 11 a A:a N
S2 A 12 a A:a N
S2 A 13 a A:a Y
S2 A 14 a A:a Y
S2 A 15 a A:a Y
S2 A 16 b A:b Y
S2 A 17 b A:b Y
S2 A 18 b A:b Y
S2 A 19 b A:b N
S2 A 20 b A:b Y
S3 A 21 a A:a N
S3 A 22 a A:a Y
S3 A 23 a A:a N
S3 A 24 a A:a N
S3 A 25 a A:a N
S3 A 26 b A:b Y
S3 A 27 b A:b Y
S3 A 28 b A:b Y
S3 A 29 b A:b Y
S3 A 30 b A:b Y
S4 A 31 a A:a N
S4 A 32 a A:a N
S4 A 33 a A:a N
S4 A 34 a A:a N
S4 A 35 a A:a N
S4 A 36 b A:b Y
S4 A 37 b A:b Y
S4 A 38 b A:b N
S4 A 39 b A:b Y
S4 A 40 b A:b N
S5 B 41 a B:a N
S5 B 42 a B:a N
S5 B 43 a B:a Y
S5 B 44 a B:a N
S5 B 45 a B:a Y
S5 B 46 b B:b Y
S5 B 47 b B:b Y
S5 B 48 b B:b N
S5 B 49 b B:b Y
S5 B 50 b B:b N
S6 B 51 a B:a N
S6 B 52 a B:a Y
S6 B 53 a B:a Y
S6 B 54 a B:a N
S6 B 55 a B:a N
S6 B 56 b B:b Y
S6 B 57 b B:b Y
S6 B 58 b B:b N
S6 B 59 b B:b N
S6 B 60 b B:b Y
S7 B 61 a B:a N
S7 B 62 a B:a N
S7 B 63 a B:a Y
S7 B 64 a B:a N
S7 B 65 a B:a N
S7 B 66 b B:b N
S7 B 67 b B:b Y
S7 B 68 b B:b Y
S7 B 69 b B:b Y
S7 B 70 b B:b N
S8 B 71 a B:a N
S8 B 72 a B:a N
S8 B 73 a B:a N
S8 B 74 a B:a N
S8 B 75 a B:a Y
S8 B 76 b B:b Y
S8 B 77 b B:b Y
S8 B 78 b B:b N
S8 B 79 b B:b Y
S8 B 80 b B:b N
S9 B 81 a B:a Y
S9 B 82 a B:a N
S9 B 83 a B:a N
S9 B 84 a B:a N
S9 B 85 a B:a N
S9 B 86 b B:b N
S9 B 87 b B:b N
S9 B 88 b B:b N
S9 B 89 b B:b Y
S9 B 90 b B:b Y
--
Derek Dunfield, PhD
Postdoctoral Fellow, MIT Intelligence Initiative
Sloan School of Management
MIT Center for Neuroeconomics, Prelec Lab
77 Massachusetts Ave E62-585
Cambridge MA 02139
More information about the R-sig-mixed-models
mailing list