merMod 对象的配置文件 (lme4)

Profile for merMod objects (lme4)

我不明白 profile 在 lmer 中是如何工作的?有时它给出的值与观察总数完全相同,有时比观察总数少或多。另外,配置文件输出中的 .zeta 是什么?

(2) 再一次

pp <- profile(fitted,"theta_",quiet=TRUE)#fitted is a fitted model

为每个随机和固定效应提供值,但是

cc <- confint(pp)

仅为方差分量生成置信区间。为什么 ?

?profile 文档中,我没有得到选项 quietquiet 是如何工作的?

(3) 运行 命令

有什么好处吗
confint(profile(fitted))

而不是 运行宁 confint(fitted) .

提前致谢。

举一个可重现的例子:

library("lme4")
fm1 <- lmer(Reaction~Days+(Days|Subject),sleepstudy)

Sometimes it [profile] gives exactly same number of values as total number of observations, and sometimes fewer or higher than total number of observations.

我不确定那是什么意思。

Also what is .zeta in the output of profile?

.zeta 列是与最小偏差之差的带符号平方根。

未为所有参数的 which (profile) 或 parm (confint) profiles/gives CI 指定任何值;指定 "theta_" 仅给出随机效应方差-协方差和残差(如果有)的结果。

## all parameters (random and fixed)
pp0 <- profile(fm1)                 
levels(pp0$.par)
## [1] "Days"        "(Intercept)" ".sig01"      ".sig02"      ".sig03"     
## [6] ".sigma"     
# random effects only
pp1 <- profile(fm1,which="theta_")
levels(pp1$.par)
## [1] ".sig01" ".sig02" ".sig03" ".sigma"

confint() 类似:

## all parameters
cc0 <- confint(pp0)
rownames(cc0)
## [1] ".sig01"      ".sig02"      ".sig03"      ".sigma"      "(Intercept)"
## [6] "Days"
## random-effects parameters only
cc1 <- confint(pp1)
## [1] ".sig01" ".sig02" ".sig03" ".sigma"

quiet 参数用于 confint()(而非 profile())。默认情况下,将 confint() 直接应用于拟合模型 会发出消息

Computing profile confidence intervals ...

警告用户正在进行 intensive/slow 计算过程。使用 quiet=TRUE 可抑制此消息。

?confint.merMod 中的 说:

The default method ‘"profile"’ amounts to confint(profile(object, which=parm), signames=oldNames, ...), level, zeta) where the ‘profile’ method ‘profile.merMod’ does almost all the computations. Therefore it is typically advisable to store the profile(.) result, say in ‘pp’, and then use ‘confint(pp, level=*)’ e.g., for different levels.

换句话说,如果您想对配置文件信息做任何其他事情(绘制配置文件,或计算多个 alpha 水平的置信区间),计算配置文件并存储它会更有效,而不是重复计算轮廓。如果您只需要默认的 95% 置信区间,那么您不妨使用 confint(fitted_model).