我的模型着眼于四个变量之间的相互作用:
model1 <- glmer(Correct ~ Ambiguity*Stroop*QT*c.(Exp.Item.TRIAL) +
(1+QT| Participant) + (1+Ambiguity+QT| Item), accuracy_model,
family=binomial,
glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 100000)))
summary(model1)
Generalized linear mixed model fit by maximum likelihood
(Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: Correct ~ Ambiguity * Stroop * QT * c.(Exp.Item.TRIAL) +
(1 + QT | Participant) + (1 + Ambiguity + QT | Item)
Data: accuracy_model
Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 100000))
AIC BIC logLik deviance df.resid
4430.2 4601.6 -2190.1 4380.2 6997
Scaled residuals:
Min 1Q Median 3Q Max
-8.8099 0.1546 0.2317 0.3459 3.6551
Random effects:
Groups Name Variance Std.Dev. Corr
Participant (Intercept) 0.45827 0.6770
QT1 0.08221 0.2867 -0.81
Item (Intercept) 0.37817 0.6150
Ambiguity1 0.07748 0.2783 0.52
QT1 0.55924 0.7478 -0.03 -0.61
Number of obs: 7022, groups: Participant, 176; Item, 40
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.605577 0.124586 20.914 < 0.0000000000000002 ***
Ambiguity1 -0.303532 0.063917 -4.749 0.00000205 ***
Stroop1 -0.006541 0.041688 -0.157 0.87532
QT1 0.279233 0.133626 2.090 0.03665 *
c.(Exp.Item.TRIAL) 0.009796 0.003647 2.686 0.00723 **
Ambiguity1:Stroop1 0.115555 0.041739 2.769 0.00563 **
Ambiguity1:QT1 0.025676 0.047736 0.538 0.59066
Stroop1:QT1 0.043568 0.041658 1.046 0.29563
Ambiguity1:c.(Exp.Item.TRIAL) -0.002592 0.003667 -0.707 0.47963
Stroop1:c.(Exp.Item.TRIAL) -0.003357 0.003674 -0.914 0.36089
QT1:c.(Exp.Item.TRIAL) -0.005858 0.003667 -1.597 0.11016
Ambiguity1:Stroop1:QT1 -0.033503 0.041689 -0.804 0.42160
Ambiguity1:Stroop1:c.(Exp.Item.TRIAL) 0.002461 0.003663 0.672 0.50177
Ambiguity1:QT1:c.(Exp.Item.TRIAL) -0.003631 0.003670 -0.989 0.32242
Stroop1:QT1:c.(Exp.Item.TRIAL) 0.008839 0.003672 2.407 0.01608 *
Ambiguity1:Stroop1:QT1:c.(Exp.Item.TRIAL) -0.005937 0.003669 -1.618 0.10563
我发现
Ambiguity
和 Stroop
之间存在显着的交互作用,两者都有两个级别的“contr.sum”编码。
为了分解交互并查看
Stroop
对于每个歧义级别的两个级别之间的相对差异,我像这样重新运行模型:
model1 <- glmer(Correct ~ (Ambiguity/Stroop) + QT*c.(Exp.Item.TRIAL) +
(1+QT| Participant) + (1+Ambiguity+QT| Item), accuracy_model,
family=binomial,
glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 100000)))
summary(model1)
Generalized linear mixed model fit by maximum likelihood
(Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: Correct ~ (Ambiguity/Stroop) + QT * c.(Exp.Item.TRIAL) +
(1 + QT | Participant) + (1 + Ambiguity + QT | Item)
Data: accuracy_model
Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 100000))
AIC BIC logLik deviance df.resid
4424.2 4533.9 -2196.1 4392.2 7006
Scaled residuals:
Min 1Q Median 3Q Max
-8.1574 0.1557 0.2317 0.3460 3.6181
Random effects:
Groups Name Variance Std.Dev. Corr
Participant (Intercept) 0.45226 0.6725
QT1 0.07779 0.2789 -0.79
Item (Intercept) 0.37206 0.6100
Ambiguity1 0.08498 0.2915 0.50
QT1 0.55937 0.7479 -0.01 -0.62
Number of obs: 7022, groups: Participant, 176; Item, 40
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.600398 0.123668 21.027 < 0.0000000000000002 ***
Ambiguity1 -0.304091 0.064284 -4.730 0.00000224 ***
QT1 0.294479 0.132830 2.217 0.0266 *
c.(Exp.Item.TRIAL) 0.009116 0.003565 2.557 0.0105 *
AmbiguityAmb:Stroop1 0.108503 0.052422 2.070 0.0385 *
AmbiguityUnamb:Stroop1 -0.130342 0.062514 -2.085 0.0371 *
QT1:c.(Exp.Item.TRIAL) -0.006014 0.003586 -1.677 0.0935 .
但是,据我了解,该模型不会包括四向、三向或双向交互,包括 Stroop 或 Ambiguity,这会影响与交互项相关的结果。
然而,当我更完整地写出模型时,交互不再像以前那样分解:
model1 <- glmer(Correct ~ (Stroop/Ambiguity) +
Ambiguity*QT*c.(Exp.Item.TRIAL) + Stroop*QT*c.(Exp.Item.TRIAL) +
(1+QT| Participant) + (1+Ambiguity+QT| Item), accuracy_model,
family=binomial,
glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 100000)))
summary(model1)
Generalized linear mixed model fit by maximum likelihood
(Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: Correct ~ (Stroop/Ambiguity) +
Ambiguity * QT * c.(Exp.Item.TRIAL) +
Stroop * QT * c.(Exp.Item.TRIAL) + (1 + QT | Participant) +
(1 + Ambiguity + QT | Item)
Data: accuracy_model
Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 100000))
AIC BIC logLik deviance df.resid
4428.0 4578.9 -2192.0 4384.0 7000
Scaled residuals:
Min 1Q Median 3Q Max
-8.3465 0.1553 0.2315 0.3459 3.4451
Random effects:
Groups Name Variance Std.Dev. Corr
Participant (Intercept) 0.45718 0.6762
QT1 0.07975 0.2824 -0.81
Item (Intercept) 0.37442 0.6119
Ambiguity1 0.07923 0.2815 0.52
QT1 0.55800 0.7470 -0.02 -0.61
Number of obs: 7022, groups: Participant, 176; Item, 40
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.602588 0.124148 20.964 < 0.0000000000000002 ***
Stroop1 -0.008040 0.041546 -0.194 0.84656
Ambiguity1 -0.298680 0.064162 -4.655 0.00000324 ***
QT1 0.284484 0.133345 2.133 0.03289 *
c.(Exp.Item.TRIAL) 0.009511 0.003626 2.623 0.00871 **
Stroop1:Ambiguity1 0.117938 0.040929 2.882 0.00396 **
Ambiguity1:QT1 0.021660 0.047630 0.455 0.64929
Ambiguity1:c.(Exp.Item.TRIAL) -0.002384 0.003659 -0.651 0.51478
QT1:c.(Exp.Item.TRIAL) -0.005349 0.003647 -1.467 0.14249
Stroop1:QT1 0.037245 0.040907 0.910 0.36256
Stroop1:c.(Exp.Item.TRIAL) -0.002972 0.003613 -0.822 0.41080
Ambiguity1:QT1:c.(Exp.Item.TRIAL) -0.003775 0.003665 -1.030 0.30302
Stroop1:QT1:c.(Exp.Item.TRIAL) 0.007750 0.003612 2.146 0.03189 *
有没有更好的方法来写出模型?还是使用 emmeans 是实现我想要的效果的更好方法(即它会考虑所有交互)?如果是这样,我会做类似的事情吗:
emm_model1 <- emmeans(model1, ~Ambiguity|Stroop)
pairs(emm_model1)