在下面的混合回归模型中,我得到了meanses
的输出和ses
估计的输出。是否也可以获得此模型中meanses - ses
(3.675037 - 2.191165
(的输出(例如,Std. Error
((我对使用任何包都持开放态度(?
library(lme4)
hsb <- read.csv('https://raw.githubusercontent.com/rnorouzian/e/master/hsb.csv')
fit <- lmer(math ~ ses + meanses + (1|sch.id), data = hsb)
coef(summary(fit))
Estimate Std. Error t value
(Intercept) 12.661262 0.1493726 84.762956
ses 2.191165 0.1086673 20.163983
meanses 3.675037 0.3776607 9.731055 # can we have `Std. Error` for `meanses - ses`?
类似的东西
> summary(multcomp::glht(fit, "ses - meanses = 0"))
Simultaneous Tests for General Linear Hypotheses
Fit: lmer(formula = math ~ ses + meanses + (1 | sch.id), data = hsb)
Linear Hypotheses:
Estimate Std. Error z value Pr(>|z|)
ses - meanses == 0 -1.484 0.422 -3.517 0.000437 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported -- single-step method)