这个问题最好用这个例子来说明,它使用了一个数据集(在 library 中faraway)和lme4library(都在 R 中)。此仅截取模型仅用于说明目的。
library(lme4)
library(faraway)
data(epilepsy)
log(mean(epilepsy$seizures))
#expected intercept in intercept only model = 2.5544
(Ep1a=glm(seizures~1, family=poisson, data=epilepsy))
#intercept term =2.554 as expected.
(Ep1b=glmer(seizures ~ 1 + (1|id), family=poisson,
data=epilepsy))#intercept term =2.214.
-------results----
1. simple glm
Call: glm(formula = seizures ~ 1, family = poisson,
data = epilepsy)
Coefficients:(Intercept) 2.554
Generalized linear mixed model fit by maximum likelihood
['glmerMod']
Family: poisson ( log )
Formula: seizures ~ 1 + (1 | id)
Random effects:
Groups Name Std.Dev.
id (Intercept) 0.7795
Number of obs: 295, groups: id, 59
Fixed Effects:
(Intercept)
2.214
我的理解是,包含随机项(id)告诉模型跨主题(在这种情况下)存在重复测量。我可以理解,这允许数据的非独立性:独立数据点少于 n=295。但是为什么固定效应截距值会减小呢?有没有会增加的情况?
我从以下网站注意到: http ://www.danielezrajohnson.com/glasgow_workshop.R 以下与我上面指定的模型无关(建议您搜索“平均演讲者”):
“......这个模型对说话者和单词有随机效应。报告的固定效应是针对一种平均说话者和单词。然而,尤其是单词,往往是一个非常倾斜的变量。总会有一些非常常见的词,可能有利于或不利于响应。混合模型在很大程度上抵消了这种权重。
在我的真实示例中,所有系数(来自两个分类因子,具有随机截距和斜率随机效应的交叉设计 - 使得 ID 中存在 DistClaz 依赖项,但 Treat 是独立的)远小于相应的平均值这些因素组合在原始数据中很明显。
Results-----------------------------------
Generalized linear mixed model fit by maximum likelihood
['glmerMod']
Family: poisson ( log )
Formula: RCP ~ Treated * DistClaz + (1 + DistClaz | ID)
AIC BIC logLik deviance
69246.20 69307.43 -34611.10 69222.20
Random effects:
Groups Name Variance Std.Dev. Corr
ID (Intercept) 12.945 3.598
DistClazAZE 11.418 3.379 -0.63
DistClazRef 8.769 2.961 -0.80 0.71
Number of obs: 1215, groups: ID, 344
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.2528 0.4240 5.313 1.08e-07 ***
TreatedTreated -2.1244 0.4916 -4.321 1.55e-05 ***
DistClazAZE 1.5925 0.5506 2.892 0.00382 **
DistClazRef 2.6302 0.3614 7.277 3.41e-13 ***
TreatedTreated:DistClazAZE 0.3613 0.6110 0.591 0.55428
TreatedTreated:DistClazRef 0.7068 0.4201 1.682 0.09248 .
---
Correlation of Fixed Effects:
(Intr) TrtdTr DsCAZE DstClR TT:DCA
TreatedTrtd -0.862
DistClazAZE -0.500 0.431
DistClazRef -0.828 0.714 0.556
TrtdT:DCAZE 0.450 -0.525 -0.901 -0.501
TrtdTrt:DCR 0.712 -0.830 -0.478 -0.860 0.583
------------------------------------------END
These are the log(means) for the combinations:
Results-------------------------------------
CE AZE Ref
No EMB 5.454940 5.808012 6.273650
Treated 3.626005 4.387088 5.253717
-------------------------------------------END
固定效应截距值 (2.2528) 与 No EMB:CE (mean = 5.4549) 相关,但这与“平均” ID 有关吗?
任何指针将不胜感激。