merMod对象的配置文件(lme4) [英] Profile for merMod objects (lme4)
问题描述
我不了解profile
在lmer中如何工作?有时它给出的值与观测值的总数完全相同,有时小于或大于观测值的总数.另外,个人资料输出中的.zeta
是什么?
I am not understanding how does profile
work in lmer ? Sometimes it 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?
(2)再次
pp <- profile(fitted,"theta_",quiet=TRUE)#fitted is a fitted model
给出每种随机和固定效果的值,但是
is giving values for every random and fixed effects, but
cc <- confint(pp)
仅对方差分量产生置信区间.为什么 ?
is producing confidence interval for only variance-components. Why ?
在?profile
文档中,我没有获得选项quiet
. quiet
如何工作?
In ?profile
documentation, I didn't get the option quiet
. How does quiet
work ?
(3)运行命令有什么优势
(3) Is there any advantage to run the command
confint(profile(fitted))
而不是运行confint(fitted)
.
谢谢.
推荐答案
举一个可复制的示例:
library("lme4")
fm1 <- lmer(Reaction~Days+(Days|Subject),sleepstudy)
有时[
profile
]给出的值与观测值总数完全相同,有时甚至少于或高于观测值总数.
Sometimes it [
profile
] gives exactly same number of values as total number of observations, and sometimes fewer or higher than total number of observations.
我不确定这是什么意思.
I'm not sure what that means.
配置文件输出中的
.zeta
是什么?
.zeta
列是与最小偏差之差的有符号平方根.
The .zeta
column is the signed square root of the difference from the minimum deviance.
不为所有参数的which
(profile
)或parm
(confint
)配置文件/给出CI指定任何值;指定"theta_"
仅给出随机效应方差-协方差和残差方差(如果有)的结果.
Specifying no value for which
(profile
) or parm
(confint
) profiles/gives CIs for all parameters; specifying "theta_"
only gives results for random effects variance-covariance and residual variance (if any).
## 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()
直接应用于拟合的模型会发出一条消息
The quiet
parameter is for confint()
(not profile()
). By default, applying confint()
directly to a fitted model issues a message
计算配置文件的置信区间...
Computing profile confidence intervals ...
警告用户正在执行计算密集/缓慢的过程.使用quiet=TRUE
禁止显示此消息.
to warn the user that a computationally intensive/slow process is taking place. Using quiet=TRUE
suppresses this message.
?confint.merMod
中的 Note 说:
默认方法个人资料"为
confint(profile(object, which=parm), signames=oldNames, ...), level, zeta)
其中配置文件"方法"profile.merMod"几乎完成了所有 计算.因此,通常建议存储 个人资料(.)结果,在"pp"中说出,然后使用"confint(pp, level = *)",例如,用于不同的级别.
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)
.
In other words, if you are going to want to do anything else with the profile information (plot profiles, or compute confidence intervals for more than one alpha-level) it is more efficient to compute the profile and store it, rather than repeatedly computing the profile. If all you want are the default 95% confidence intervals then you might as well use confint(fitted_model)
.
这篇关于merMod对象的配置文件(lme4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!