5
$\begingroup$

I'm trying to understand how to either adjust my data, model it differently, or both.

I have an experiment where the subject is given a test, then an Intervention (A or B), then given another test. I want to see what the main effect of the intervention is on the difference between pre and post intervention scores.

The data

My dataset looks like this:

Subject Session Condition Intervention Difficulty Score
1       1       Pre       A            1          80
1       1       Post      A            2          70
1       2       Pre       B            2          75
1       2       Post      B            2          80
.
.
.
50      9       Pre       A            5          80
50      9       Post      A            6          70
50      10      Pre       A            6          65
50      10      Post      A            5          80

What I tried

Originally, I set up my model as repeated measures ANOVA like this:

modelA <- aov(dScore ~ Intervention + Error(Subject/Intervention))

Where dScore is the difference in Score between the Pre and Post intervention for a given Session.

Problems

I have two problems with this model:

First, the testing protocol during the study dictates that when a subject performs particularly well, the difficulty of the test is increased. Similarly when the subject performs poorly, the difficulty is decreased. You can see how that might look in the dummy data above.

To this end, my ideas are to either apply a z-score within difficulty levels - creating ZScore, or add Difficulty as a covariate.

Second, there are some subjects who received both interventions during the course of the study, and others that only received one or the other. This currently isn't being accounted for in the model, as far as I can tell.

My ideas for solutions

The idea I have is to use a mixed effects model instead of a repeated measures ANOVA. Something like this:

modelB <- lme(dScore ~ Intervention + Difficulty, random = ~ 1 + Intervention | Subject)

Or, splitting Condition back out but using ZScore instead of dScore:

modelC <- lme(ZScore ~ Condition*Intervention, random = ~ 1 + Condition | Subject)

Can someone explain to me whether these are sensible approaches, or what I can be doing differently?

$\endgroup$
6
  • 2
    $\begingroup$ (Only a comment) I think your idea using an LME is very reasonable; I think that the idea of using Difficulty is very reasonable too. I think that z-scoring the dScore is unnecessary at first instance, I would do it only for estimation purposes usually. I do not understand why you do not model Score directly and use Condition as a covariate. Otherwise how can you assess what is the associated Difficulty anyway? BTW is Difficulty also a binary variable or it just happens you have values 1/2 on the snippet you show? (+1, nice question. Welcome to the community.) $\endgroup$
    – usεr11852
    Commented Feb 21, 2016 at 3:30
  • $\begingroup$ @usεr11852 Thank you for your comments. Difficulty isn't binary, it's an ordinal with 7 possible values. I'll edit my snippet to clear up the confusion. $\endgroup$
    – Millyj
    Commented Feb 21, 2016 at 3:53
  • $\begingroup$ With regard to your question about not modeling Score directly, that seems closer to what I want but I start to get confused about how to model all the moving parts. Are you suggesting Score ~ Condition*Difficulty + Intervention, with 1 + Condition|Subject as the random term? $\endgroup$
    – Millyj
    Commented Feb 21, 2016 at 3:59
  • 1
    $\begingroup$ Thank you for the clarifications. Yes, something like that would seem more natural to me. Condition and Difficulty are properly accounted and you control for Subject specific effects within a Condition. Just a note: Are you sure you do not want 1|Condition\Subject? (Condition|Subject) specifies that the effects of Condition vary across levels of Subject, which OK, it is plausible but really really pessimistic. $\endgroup$
    – usεr11852
    Commented Feb 21, 2016 at 4:17
  • $\begingroup$ @usεr11852 Thank you! This makes things much more clear to me. You're right, specifying Condition varying across levels of Subject is not what I intended at all. $\endgroup$
    – Millyj
    Commented Feb 21, 2016 at 5:08

2 Answers 2

2
+50
$\begingroup$

Yes, I think that in general what you propose appears rather reasonable.

Both the idea of using a linear mixed effects model as well as using information about the administered test's Difficulty seem like reasonable solutions to modelling the effect of this intervention. As mentioned I do not see the reason to immediately z-transform your response variable; I would suggest that only if one wanted to change the way the $\beta$ coefficients are interpreted and/or there were some numerical issues during model estimation.

Based on the available information I think that a model similar to: Score ~ Condition*Difficulty + Intervention (1 |Condition:Subject) (I use lmer syntax) seems more reasonable. (Condition|Subject) specifies that the effects of Condition vary across levels of Subject; this is probably too pessimistic and a bit over-parametrized too (this what is usually referred as randomized block design by the way). Taking this, one notch down is: (1|Condition/Subject). This specification would be equivalent to (1|Condition) + (1|Condition:Subject); it would mean one estimates a random effect for Condition based on only two levels which is just wrong so again I would not suggest it (this what is usually referred as nested design). This brings us to (1|Condition:Subject). I think this is plausible: one would fit an intercept for the interaction between Condition and Subject.

Something that worries me is that you do not account for Session explicitly. Are all sessions different and/or independent from the others? Usually some "learning" takes place between sessions. One would normally suspect that the subjects (if anything) would get more accustomed to the testing procedure. I think that it would be sensible to at least test Session as a fixed effect. To that extent, one could try to have random slopes due to Session within Subject with something like (Session+0|Subject) but this is a bit more open-ended. (Notice that this syntax does not allow variation based on a Subject intercept. I proposed it because I assume that you already have the Condition:Subject terms.) Feel free to shoot-down this worry! :)

General advice: As your design is non-trivial I would suggest you try to generate some data based on the assumptions you are willing to make and on the constants your original modelling task has (sample sizes, number of session per subject, number of subjects, etc.). Then you could try to fit the model you propose on this data and see if you get back reasonable estimates. Testing different random effect structures becomes a cherry-picking exercise trying to "squeeze more significance out of the remaining terms" (glmm.wikidot's FAQ) after a while so I would advice you against it. And bootstrap that model in the end. Unless you have parameters located close to the parameter boundary space this usually is a very good test.

$\endgroup$
5
  • $\begingroup$ I was worried about about accounting for the learning effect across the Session variable too. I was going to ask about that next - thanks for picking that up. Your suggestion makes perfect sense to me. Thank you for explaining things so well. $\endgroup$
    – Millyj
    Commented Feb 21, 2016 at 17:33
  • $\begingroup$ I like the idea of generating fake data to test whether the model is sensitive to the effects I'm expecting given the constraints I'm dealing with. I'm going to try that today. $\endgroup$
    – Millyj
    Commented Feb 21, 2016 at 17:34
  • $\begingroup$ @Millyj: Cool. I added some clarifications about the designs. $\endgroup$
    – usεr11852
    Commented Feb 21, 2016 at 18:04
  • $\begingroup$ This worked beautifully. Thank you again for the clear explanation. $\endgroup$
    – Millyj
    Commented Feb 25, 2016 at 19:00
  • $\begingroup$ @Millyj: Great; I am glad this is sorted out. (And thanks for the bounty.) $\endgroup$
    – usεr11852
    Commented Feb 25, 2016 at 22:55
2
$\begingroup$

Well normally one would do a paired t-test on the difference between the score on the pre- and post-test.

The problem here is that your setup isn't very clean from a theoretical perspective. Three issues:

  • You mention that some participants got both treatments. This could be solved by calling this a third group.
  • If you want to know what the effect of a treatment is, you also need a no-treatment group, as a baseline. But maybe you are only interested in the differences between these two treatments.
  • The difficulty scales could be a show stopper here. Because it is unclear what the effect is of a level change is on the score. Trying to model this difference would only make sense if you have a very large dataset. I'm guessing it would be better to just repeat the experiment with the difficulty locked between the two sessions.
$\endgroup$
3
  • 1
    $\begingroup$ When you do a regression and look at the coefficient's significance you do a $t$-test too essentially. The LME regression proposed by the OP is just a more advanced way of control for certain variables and augment the variance structure of the underlaying model. $\endgroup$
    – usεr11852
    Commented Feb 21, 2016 at 17:29
  • 1
    $\begingroup$ Identifying the effect of Difficulty on the score should be at least partially addressed by modeling it explicitly in the LME. But I agree with your point that the models described here will require large sample sizes. OP hasn't said how many subjects are in the dataset, unless we infer from the example that it's 50? $\endgroup$
    – neerajt
    Commented Feb 21, 2016 at 18:22
  • $\begingroup$ @neerajt: I made that assumptions; yes. $\endgroup$
    – usεr11852
    Commented Feb 21, 2016 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.