I have oxyHb measures from each of the 16 optodes from fNIR and trying to conduct multilevel analysis by using RStudio. My fixed variable is gender and my random variable is Nback conditions (which has 4 levels, 0-, 1-, 2-, and 3-back). In my model, participants are nested within nback conditions.

When I search examples on internet, I've figured out that repeated measures in multilevel models are generally time-varying variables which is convenient to apply growth analysis. However, in my model, repeated measures are conditions. Therefore, I am stuck on constructing my model. 

Also, I was wondering about using random slopes or random intercepts. Which one should I use in a research design like this?

Here is my R code:

#Random slopes model

library(nlme)

model1 = lme(fixed = Optode1 ~ NbackType + gender,

method = "ML",

na.action = "na.omit",

random = ~ NbackType|participant,

data = oxyHb)

summary(model1)

#Random intercepts model

model2 = lme(fixed = Optode1 ~ NbackType + gender,

method = "ML",

na.action = "na.omit",

random = ~ 1|participant/NbackType,

data = oxyHb)

summary(model2)

Similar questions and discussions