glmer 中的交互(统计建议)
Interaction in glmer (stats advice)
我需要帮助来理解和跟进使用 lme4 的 glmer() 获得的交互。
数据来自一项语言处理实验,该实验研究三个分类变量 (control/copula/gender) 对二项式响应(首选或不首选)的影响。每个实验因素都有两个水平:
控制(subject/object)
联结 (ser/estar)
性别(masculine/feminine)。
我运行以下型号:
model1= glmer(preferences~control*copula*gender+(1|participant), family=binomial, data=data2)
这些是我获得的结果:
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: preferences_narrow ~ control * copula * gender + (1 | participant)
Data: data2
AIC BIC logLik deviance df.resid
1208.6 1261.1 -595.3 1190.6 2517
Scaled residuals:
Min 1Q Median 3Q Max
-8.6567 0.1970 0.2337 0.2883 0.5371
Random effects:
Groups Name Variance Std.Dev.
participant (Intercept) 0.254 0.504
Number of obs: 2526, groups: participant, 105
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.5034 0.2147 11.660 < 2e-16 ***
controlsubject 0.4882 0.3172 1.539 0.12380
copulaser 0.4001 0.3237 1.236 0.21646
gendermasc -0.4524 0.2659 -1.701 0.08888 .
controlsubject:copulaser -1.0355 0.4526 -2.288 0.02215 *
controlsubject:gendermasc 0.5790 0.4430 1.307 0.19121
copulaser:gendermasc 1.7343 0.5819 2.980 0.00288 **
controlsubject:copulaser:gendermasc -1.3121 0.7540 -1.740 0.08181 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) cntrls coplsr gndrms cntrlsbjct:c cntrlsbjct:g cplsr:
contrlsbjct -0.602
copulaser -0.588 0.401
gendermasc -0.724 0.488 0.479
cntrlsbjct:c 0.415 -0.701 -0.716 -0.342
cntrlsbjct:g 0.432 -0.716 -0.287 -0.599 0.502
cplsr:gndrm 0.332 -0.223 -0.556 -0.457 0.397 0.274
cntrlsbjc:: -0.252 0.421 0.430 0.352 -0.600 -0.588 -0.772
有两个显着的交互作用 controlsubject:copulaser
和 copulaser:gendermasc
。
我使用 emmeans 跟进了第一次互动:
emmeans(model1, list(pairwise ~ control + copula), adjust = "tukey")
结果似乎表明多重对比正在推动互动(当我为第二次互动做同样的事情时会发生类似的事情):
NOTE: Results may be misleading due to involvement in interactions
$`emmeans of control, copula`
control copula emmean SE df asymp.LCL asymp.UCL
object estar 2.277256 0.1497913 Inf 1.983670 2.570841
subject estar 3.054906 0.1912774 Inf 2.680009 3.429802
object ser 3.544448 0.2697754 Inf 3.015698 4.073198
subject ser 2.630568 0.1752365 Inf 2.287110 2.974025
Results are averaged over the levels of: gender
Results are given on the logit (not the response) scale.
Confidence level used: 0.95
$`pairwise differences of control, copula`
contrast estimate SE df z.ratio p.value
object,estar - subject,estar -0.7776499 0.2215235 Inf -3.510 0.0025
object,estar - object,ser -1.2671927 0.2910689 Inf -4.354 0.0001
object,estar - subject,ser -0.3533119 0.2088155 Inf -1.692 0.3279
subject,estar - object,ser -0.4895427 0.3138092 Inf -1.560 0.4017
subject,estar - subject,ser 0.4243380 0.2396903 Inf 1.770 0.2877
object,ser - subject,ser 0.9138807 0.3048589 Inf 2.998 0.0145
Results are averaged over the levels of: gender
Results are given on the log odds ratio (not the response) scale.
P value adjustment: tukey method for comparing a family of 4 estimates
然而,注意是什么意思?
NOTE: Results may be misleading due to involvement in interactions
这是跟踪这些互动的好程序吗?
提前致谢! :)
如注释中所示,显示的估计值是控制、copula 和性别组合的预测平均值,按性别取平均值。同时,该模型包括性别与其他两个因素之间的相互作用,这表明这些平均值可能没有意义。您可以通过构建 3 向预测图来形象化这一点:
emmip(model1, gender ~ control * copula)
如果一个案例与下一个案例的预测比较完全不同,那么它们的平均值将是无稽之谈。但如果它们比较起来几乎相同,那么将它们取平均就可以了。这就是警告的内容。
我猜你确实开会担心与性别的互动——在这种情况下你应该单独进行比较:
emmeans(model1, pairwise ~ control * copula | gender)
我需要帮助来理解和跟进使用 lme4 的 glmer() 获得的交互。
数据来自一项语言处理实验,该实验研究三个分类变量 (control/copula/gender) 对二项式响应(首选或不首选)的影响。每个实验因素都有两个水平: 控制(subject/object) 联结 (ser/estar) 性别(masculine/feminine)。
我运行以下型号:
model1= glmer(preferences~control*copula*gender+(1|participant), family=binomial, data=data2)
这些是我获得的结果:
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: preferences_narrow ~ control * copula * gender + (1 | participant)
Data: data2
AIC BIC logLik deviance df.resid
1208.6 1261.1 -595.3 1190.6 2517
Scaled residuals:
Min 1Q Median 3Q Max
-8.6567 0.1970 0.2337 0.2883 0.5371
Random effects:
Groups Name Variance Std.Dev.
participant (Intercept) 0.254 0.504
Number of obs: 2526, groups: participant, 105
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.5034 0.2147 11.660 < 2e-16 ***
controlsubject 0.4882 0.3172 1.539 0.12380
copulaser 0.4001 0.3237 1.236 0.21646
gendermasc -0.4524 0.2659 -1.701 0.08888 .
controlsubject:copulaser -1.0355 0.4526 -2.288 0.02215 *
controlsubject:gendermasc 0.5790 0.4430 1.307 0.19121
copulaser:gendermasc 1.7343 0.5819 2.980 0.00288 **
controlsubject:copulaser:gendermasc -1.3121 0.7540 -1.740 0.08181 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) cntrls coplsr gndrms cntrlsbjct:c cntrlsbjct:g cplsr:
contrlsbjct -0.602
copulaser -0.588 0.401
gendermasc -0.724 0.488 0.479
cntrlsbjct:c 0.415 -0.701 -0.716 -0.342
cntrlsbjct:g 0.432 -0.716 -0.287 -0.599 0.502
cplsr:gndrm 0.332 -0.223 -0.556 -0.457 0.397 0.274
cntrlsbjc:: -0.252 0.421 0.430 0.352 -0.600 -0.588 -0.772
有两个显着的交互作用 controlsubject:copulaser
和 copulaser:gendermasc
。
我使用 emmeans 跟进了第一次互动:
emmeans(model1, list(pairwise ~ control + copula), adjust = "tukey")
结果似乎表明多重对比正在推动互动(当我为第二次互动做同样的事情时会发生类似的事情):
NOTE: Results may be misleading due to involvement in interactions
$`emmeans of control, copula`
control copula emmean SE df asymp.LCL asymp.UCL
object estar 2.277256 0.1497913 Inf 1.983670 2.570841
subject estar 3.054906 0.1912774 Inf 2.680009 3.429802
object ser 3.544448 0.2697754 Inf 3.015698 4.073198
subject ser 2.630568 0.1752365 Inf 2.287110 2.974025
Results are averaged over the levels of: gender
Results are given on the logit (not the response) scale.
Confidence level used: 0.95
$`pairwise differences of control, copula`
contrast estimate SE df z.ratio p.value
object,estar - subject,estar -0.7776499 0.2215235 Inf -3.510 0.0025
object,estar - object,ser -1.2671927 0.2910689 Inf -4.354 0.0001
object,estar - subject,ser -0.3533119 0.2088155 Inf -1.692 0.3279
subject,estar - object,ser -0.4895427 0.3138092 Inf -1.560 0.4017
subject,estar - subject,ser 0.4243380 0.2396903 Inf 1.770 0.2877
object,ser - subject,ser 0.9138807 0.3048589 Inf 2.998 0.0145
Results are averaged over the levels of: gender
Results are given on the log odds ratio (not the response) scale.
P value adjustment: tukey method for comparing a family of 4 estimates
然而,注意是什么意思?
NOTE: Results may be misleading due to involvement in interactions
这是跟踪这些互动的好程序吗?
提前致谢! :)
如注释中所示,显示的估计值是控制、copula 和性别组合的预测平均值,按性别取平均值。同时,该模型包括性别与其他两个因素之间的相互作用,这表明这些平均值可能没有意义。您可以通过构建 3 向预测图来形象化这一点:
emmip(model1, gender ~ control * copula)
如果一个案例与下一个案例的预测比较完全不同,那么它们的平均值将是无稽之谈。但如果它们比较起来几乎相同,那么将它们取平均就可以了。这就是警告的内容。
我猜你确实开会担心与性别的互动——在这种情况下你应该单独进行比较:
emmeans(model1, pairwise ~ control * copula | gender)