我正在尝试回答 Pinhiero 和 Bates Mixed Effects Models in S and S-Plus的问题,解释随机效应如何无法比具有混合效应的 gls 模型带来任何好处。
该模型包含随机效应
library(nlme)
fm1Ovar.lme <- lme( follicles ~ 1 + sin(2*pi*Time) + cos(2*pi*Time),
data = Ovary,
random = pdDiag(~sin(2*pi*Time)),
corr = corARMA(p = 1, q = 1))
输出
fm1Ovar.lme
Linear mixed-effects model fit by REML
Data: Ovary
Log-restricted-likelihood: -771.9471
Fixed: follicles ~ 1 + sin(2 * pi * Time) + cos(2 * pi * Time)
(Intercept) sin(2 * pi * Time) cos(2 * pi * Time)
12.1248728 -2.9198264 -0.8487095
Random effects:
Formula: ~sin(2 * pi * Time) | Mare
Structure: Diagonal
(Intercept) sin(2 * pi * Time) Residual
StdDev: 2.614435 1.004898 3.733423
Correlation Structure: ARMA(1,1)
Formula: ~1 | Mare
Parameter estimate(s):
Phi1 Theta1
0.7868896 -0.2793591
Number of Observations: 308
Number of Groups: 11
而这个模型没有
fm1Ovar.gls <- gls( follicles ~ 1 + sin(2*pi*Time) + cos(2*pi*Time),
data = Ovary,
corr = corARMA(form = ~ 1 | Mare, p = 1, q = 1) )
输出
fm1Ovar.gls
Generalized least squares fit by REML
Model: follicles ~ 1 + sin(2 * pi * Time) + cos(2 * pi * Time)
Data: Ovary
Log-restricted-likelihood: -773.3402
Coefficients:
(Intercept) sin(2 * pi * Time) cos(2 * pi * Time)
12.0587080 -2.8832412 -0.8035591
Correlation Structure: ARMA(1,1)
Formula: ~1 | Mare
Parameter estimate(s):
Phi1 Theta1
0.8908103 -0.3496050
Degrees of freedom: 308 total; 305 residual
Residual standard error: 4.597197
比较对数似然比
anova(fm1Ovar.lme, fm1Ovar.gls)
Model df AIC BIC logLik Test L.Ratio p-value
fm1Ovar.lme 1 8 1559.894 1589.657 -771.9471
fm1Ovar.gls 2 6 1558.680 1581.002 -773.3402 1 vs 2 2.786262 0.2483
表示具有随机效应的lme
模型与没有随机效应的模型相比没有显着优势gls
。所以我想我们会倾向于gls
参数更少的更简约的模型。
我想知道如何解释这一点?据推测,在模型中包含随机效应没有任何好处说明了这些随机效应,但是什么?是不是母马间(即主体间)的变化非常低?
我想一个更广泛的问题是我不明白在这种情况下实际上随机效应是什么。我通过gls
模型了解到,我们正在对组内观察值之间的相关性进行建模(在本例中为 Mares),类似于混合效应模型中发生的情况。那么随机效应建模为我们提供了建模相关结构没有提供的哪些额外信息呢?