此问题已经在这里有了答案:
我已经使用R中的lme4
软件包拟合了线性混合效果模型。我正在预测具有两个类别固定因子(outcome
(向上/向下)和direction
(正)的连续utility
变量/ neutral / negative)和Participant
作为随机因素。我想测试direction
,utility
以及两者在outcome
上的交互作用,因此我编写了一个模型,如下所示:
model <- lmer(outcome ~ direction * utility + (1|Participant), data = DF)
并且输出看起来像这样:
Linear mixed model fit by REML ['lmerMod']
Formula: outcome ~ direction * utility + (1 | Participant)
Data: DF
REML criterion at convergence: 35381.7
Scaled residuals:
Min 1Q Median 3Q Max
-4.5722 -0.5269 -0.2075 0.2518 5.8625
Random effects:
Groups Name Variance Std.Dev.
Participant (Intercept) 5.832 2.415
Residual 96.155 9.806
Number of obs: 4761, groups: Participant, 100
Fixed effects:
Estimate Std. Error t value
(Intercept) 8.9769 0.3189 28.153
directionUpwards -6.1652 0.2912 -21.172
utility.L -4.1623 0.3577 -11.635
utility.Q -3.0612 0.3668 -8.346
directionUpwards:utility.L 4.2283 0.5000 8.456
directionUpwards:utility.Q 3.6176 0.5049 7.165
Correlation of Fixed Effects:
(Intr) drctnU utlt.L utlt.Q drU:.L
drctnUpwrds -0.473
utility.L -0.068 0.076
utility.Q -0.019 0.019 -0.070
drctnUpw:.L 0.051 0.008 -0.720 0.049
drctnUpw:.Q 0.015 -0.020 0.052 -0.720 0.011
输出中utility
的L和Q是什么意思?由于它们与utility
的可能值不对应,因此我不确定如何解释。
这不是lme4
特定的。
这些项是正交多项式对比度的线性(L
)和二次(Q
)系数;发生这种情况是因为utility
已定义为有序因子。如果您有更多级别的因子,它们将被标记为C
(立方),4
,(四次四阶),5
等。>
如果您想返回因子的一般行为(即治疗对比),可以将utility
转换回无序(data <- transform(data,utility=factor(utility,ordered=FALSE))
),或使用各种方法之一指定您想要治疗对比。
L
和Q
代表线性和二次对比度。默认情况下,R对无序因子进行处理对比,对有序因子进行多项式对比。