[R-sig-ME] Multilevel Model in R

Ilgim Hepdarcan ilgim.hepdarcan at izmirekonomi.edu.tr
Thu Mar 16 22:55:11 CET 2017


Dear all! 
My study consists of 3 trials and each trial includes four different n-back types, 0-,1-,2-,3-back. Each participant had 12 n-back conditions, in a different order. Therefore, my design is within-subject design. Participants are between factors and gender of the participant is the covariate of that between factor. 


While participants were performing n-back task, I have measured their dorsolateral prefrontal cortex activation via 16-channeled fNIR and obtained oxygenated hemoglobin measures from each of the 16 channels and I'm trying to conduct multilevel analysis by using R. My fixed variable is gender and my random variable is Nback Types (which has 4 levels, 0-, 1-, 2-, and 3-back) which is categorical. In my model, participants are nested within nback types. 




Because NbackType is categorical, I've wondered whether it is okay to test random slopes. 




Last but not least, would you share your opinions about how to interpret this random slopes model? 





#Null model 
#Optode1 
library(lme4) 
library(lmerTest) 
Optode1.m1 = lmer (Optode1 ~ 1 + 
(1|participant), 
na.action = na.exclude, 
data=oxyHbConditionCellbyCell, 
REML=FALSE) 
summary(Optode1.m1) 


##Nback model Random intercept 
#Optode1 
library(lme4) 
library(lmerTest) 
Optode1.m2 = lmer (Optode1 ~ NbackType + 
(1|participant:NbackType), 
na.action = na.exclude, 
data=oxyHbConditionCellbyCell, 
REML=FALSE) 
summary(Optode1.m2) 

##Nback model Random slope 
#Optode1 
library(lme4) 
library(lmerTest) 
Optode1.m3 = lmer (Optode1 ~ NbackType + 
(NbackType|participant), 
na.action = na.exclude, 
data=oxyHbConditionCellbyCell, 
REML=FALSE) 
summary(Optode1.m3) 




##Nback gender model Random intercept 
#Optode1 
library(lme4) 
library(lmerTest) 
Optode1.m4 = lmer (Optode1 ~ NbackType + gender + 
(1|participant:NbackType), 
na.action = na.exclude, 
data=oxyHbConditionCellbyCell, 
REML=FALSE) 
summary(Optode1.m4) 




##Nback gender model Random intercept 
#Optode1 
library(lme4) 
library(lmerTest) 
Optode1.m5 = lmer (Optode1 ~ NbackType + gender + 
(NbackType|participant), 
na.action = na.exclude, 
data=oxyHbConditionCellbyCell, 
REML=FALSE) 
summary(Optode1.m5) 




##Nback gender model Random intercept 
#Optode1 
library(lme4) 
library(lmerTest) 
Optode1.m6 = lmer (Optode1 ~ NbackType * gender + 
(1|participant:NbackType), 
na.action = na.exclude, 
data=oxyHbConditionCellbyCell, 
REML=FALSE) 
summary(Optode1.m6) 




##Nback gender interaction model Random slope 
#Optode1 
library(lme4) 
library(lmerTest) 
Optode1.m7 = lmer (Optode1 ~ NbackType * gender + 
(NbackType|participant), 
na.action = na.exclude, 
data=oxyHbConditionCellbyCell, 
REML=FALSE) 
summary(Optode1.m7) 




anova(Optode1.m1,Optode1.m2,Optode1.m3,Optode1.m4,Optode1.m5,Optode1.m6,Optode1.m7) 


Ilgým Hepdarcan 
Izmir University of Economics 
Experimental Psychology MD 


	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list