On Sun, Mar 19, 2017 at 3:19 PM, Ilgim Hepdarcan
<ilgim.hepdarcan at izmirekonomi.edu.tr> wrote:
Dear all,
I'm conducting multilevel linear mixed effects model analysis for my MD Thesis, but I've got confused about the models and the results of the models that I've tested. So, 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.
These statements seem a little surprising and inconsistent with what I understand about your design. "participants are nested within Nback types" would suggest that each participant gets only a single Nback type (and that there are multiple patients per Nback type), which seems inconsistent with your statement "each participant had 12 n-back conditions". (Does each participant get each of the 4 n-back conditions exactly 3 times? That isn't necessary but would probably maximize statistical power.) Also, you say "my random variable is Nback types", which seems surprising and is inconsistent with the formulas you give below (which include Nback type as a fixed effect)
Because NbackType is categorical, I've wondered whether it is okay to test random slopes.
Yes: "random slopes" for categorical predictors equates to "among-individual variation in effects".
#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) Result of the ANOVA
anova(Optode1.m1,Optode1.m2,Optode1.m3,Optode1.m4,Optode1.m5,Optode1.m6,Optode1.m7)
Data: oxyHbConditionCellbyCell Models: object: Optode1 ~ 1 + (1 | participant) ..1: Optode1 ~ NbackType + (1 | participant:NbackType) ..3: Optode1 ~ NbackType + gender + (1 | participant:NbackType) ..5: Optode1 ~ NbackType * gender + (1 | participant:NbackType) ..2: Optode1 ~ NbackType + (NbackType | participant) ..4: Optode1 ~ NbackType + gender + (NbackType | participant) ..6: Optode1 ~ NbackType * gender + (NbackType | participant) Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq) object 3 34885 34910 -17439.6 34879 ..1 6 16010 16059 -7999.0 15998 18881.1967 3 < 2e-16 *** ..3 7 16012 16069 -7999.0 15998 0.0471 1 0.82819 ..5 10 16011 16093 -7995.6 15991 6.8243 3 0.07771 . ..2 15 16013 16136 -7991.6 15983 8.0654 5 0.15267 ..4 16 16015 16146 -7991.4 15983 0.4057 1 0.52416 ..6 19 16014 16170 -7988.1 15976 6.4941 3 0.08990 . --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
You might want to make your null model ~ 1 + (1 | participant/NbackType) and your subsequent (non-random-slope) models should probably use the same random effect term. This makes participants *crossed* with NbackType (there is a random effect of participant, potentially a fixed effect of NbackType, and a random effect of the interaction between NbackType and participant). Your anova above suggests that the *combination* of NbackType and variation of NbackType within participant is significant. While it's not impossible for the overall anova result to be significant while the individual levels aren't, in this case I think the mismatch comes from the mismatch in the random effects term between the full and null models.
As the ANOVA results indicated the significant model states at the below. Linear mixed model fit by maximum likelihood t-tests use Satterthwaite approximations to degrees of freedom [lmerMod] Formula: Optode1 ~ NbackType + (1 | participant:NbackType) Data: oxyHbConditionCellbyCell AIC BIC logLik deviance df.resid 16010.1 16059.2 -7999.0 15998.1 26369 Scaled residuals: Min 1Q Median 3Q Max -4.7604 -0.4671 -0.0612 0.4037 7.3160 Random effects: Groups Name Variance Std.Dev. participant:NbackType (Intercept) 0.1653 0.4065 Residual 0.1036 0.3219 Number of obs: 26375, groups: participant:NbackType, 172 Fixed effects: Estimate Std. Error df t value Pr(>|t|) (Intercept) -0.05137 0.06212 172.02000 -0.827 0.409 NbackTypeoneback 0.01459 0.08785 172.02000 0.166 0.868 NbackTypetwoback 0.01540 0.08785 172.02000 0.175 0.861 NbackTypethreeback -0.05264 0.08785 172.02000 -0.599 0.550 But, none of them is significant even my Intercept. How should I interpret this result? Your answer is extremely important for me. Thank you in advance. Ilg?m Hepdarcan Experimental Psychology, MD