2

I have a question regarding the modelling of fixed effects and random effects of two repeated measures. My dataset looks like this:

subject id      condition      trial      DV
    1                1           1        2
    1                1           2        5
    1                1           3        6    
    1                2           1        3    
    1                2           2        8   
    1                2           3        9    
    2                1           1        5    
    2                1           2        4    
    2                1           3        3    
    2                2           1        7    
    2                2           2        8    
    2                2           3        6    
    3                1           1        4    
    3                1           2        5   
    3                1           3        7    
    3                2           1        9    
    3                2           2        10    
    3                2           3        2    

So, there is a task with two conditions and every participant does both conditions (repeated-measures) and every condition exists of 3 trials (repeated-measures). Then there a continuous DV.

(1) First of all, I am wondering whether the variables subject id, condition and trial are nested or crossed. All subjects are doing both levels of conditions so I thought subject and condition are crossed. Is that correct?
Although condition 1 and condition 2 are both having three levels of trial they are of course not the same trials in time (as participants play the conditions of the task not at the same time but subsequent to each other). Does this mean condition and trial are nested? Or are they also crossed because they both have three levels of trial?
Furthermore, I think subject and trial are crossed as all participants experience 6 levels of trial. Is this correct?

(2) Second, I like to run a multi-level model but I am not sure how to specify the fixed effects and random effects. The lowest level will be trial/time as I want to model the curve/growth trajectory of the DV over time (trial) for both conditions. In reality, there are 20 trials per condition. I now have the following code to model a random intercept for every participant:

m1 = gls(DV~1, data=dataset,method = "ML", na.action = na.exclude) 
m2 = lme(DV~ 1 , data = dataset, random = ~1|subject id, method = "ML", na.action = na.exclude)

M2 is a significant better fit to the data than M1. But does this mean that a random intercept is modelled across all 6 trials per participant? I actually want to know this per condition. So should I just make a multi-level model per condition (so seperate all analyses for both conditions)? Or can I include condition in the code and should the code be:

m3 = lme(DV~ 1 , data = dataset, random = ~1|subject id/condition, method = "ML", na.action = na.exclude)

If M3 has a significant better fit to the data than M1, does it mean there is a random intercept for both conditions?

(3) If I want to know if there is an effect of trial per condition, how should I model this? Like this?

m4 = lme(DV~ trial , data = dataset, random = ~1|subject id/condition, method = "ML", na.action = na.exclude)

Would a significant effect of trial mean there is a linear effect of trial within both conditions?

(4) Last, I would like to know per condition (so not for the overall 6 trials) if there is a random slope for the relationship between the DV and trial. I dont want to know this for the overall 6 trials but per condition (in reality 20 trials per condition). Would the model be:

m5 = lme(DV~ trial, random = ~condition/trial|subject id/condition, method = "ML", data = dataset) 

Overall I am confused how to deal with the two repeated variables (condition and trial) in the model. I hope someone can help!

Anna
  • 21
  • 1

0 Answers0