model.average.list(RMark)
model.average.list()所属R语言包:RMark
Compute model averaged estimates of real parameters from a list structure
从列表结构计算模型的平均实际参数的估计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A generic function to compute model averaged estimates and their standard errors or variance-covariance matrix
一个普通的函数来计算模型的平均估计值及其标准误差或方差 - 协方差矩阵
用法----------Usage----------
## S3 method for class 'list'
model.average(x, revised=TRUE,...)
参数----------Arguments----------
参数:x
a list containing the following elements: 1) estimate - a vector or matrix of estimates, 2)a vector of model selection criterion value named AIC,AICc,QAIC,QAICc or a weight variable that sums to 1 across models, and 3) a vector or matrix named se which give the model-specific standard errors for each estimate or a list of matrices named vcv which give the model-specific variance-covariance matrices.
一个列表,其中包含以下元素:1)estimate - 一个向量或矩阵的估计,2)向量的值,命名为AIC,AICc,QAIC,QAICc或weight变量的模型选择标准,金额为1跨模式,以及3)一个向量或矩阵的命名se给特定机型的标准错误估计或命名的矩阵列表为每个vcv给特定模型的方差 - 协方差矩阵。
参数:revised
if TRUE it uses eq 6.12 from Burnham and Anderson (2002) for model averaged se; otherwise it uses eq 4.9
如果是TRUE,使用式6.12伯纳姆和安德森(2002年)平均的模型,否则它使用均衡器4.9
参数:...
additional arguments passed to specific functions
额外的参数传递给特定的功能
Details
详细信息----------Details----------
If a single estimate is being model-averaged then estimate and se are vectors with an entry for each model. However, if there are several estimatee being averaged then both estimate and se should be matrices in which the estimates for each model are a row in the matrix. Regardless, if vcv is specified it should be a list of matrices and in the case of a single estimate, each matrix is 1x1 containing the estimated sample-variance but that would be rather useless and se should be used instead.
如果有一个估计的模型平均estimate和se模型为每个项目的向量。但是,如果有是几个estimatee的平均两个estimate和se应该是矩阵中,矩阵中的每个模型的估计有一排。无论如何,如果vcv指定,它应该是一个矩阵列表和一个单一的预算的情况下,每个矩阵是1x1的估计样本方差,但是这将是相当无用的和se应该是代替使用。
If the list contains an element named AIC,AICc,QAIC, or QAICc, then the minimum value is computed and subtracted to compute delta values relative to the minimum. These are then converted to Akaike weights which are exp(-.5*delta) and these are normalized to sum to 1. If the list does not contain one of the above values then it should have a variable named weight. It is normalized to 1. The model-averaged estimates are computed using equation 4.1 of Burnham and Anderson (2002).
如果列表中包含命名的元素AIC,AICc,QAIC或QAICc,然后最低值计算,并减去计算Delta的最低值。然后这些转换成赤池重量exp(-.5*delta),这些都是标准化等于1。如果列表中不包含一个以上的值,那么它应该有一个变量名为weight。它被标准化为1。该模型的平均估计计算使用公式4.1伯纳姆和安德森(2002)。
If the contains a matrix named vcv, then a model-averaged variance-covariance matrix is computed using formulae given on page 163 of Burnham and Anderson (2002). If there is no element named vcv then there must be an element se which contains the model-specific estimates of the standard errors. The unconditional standard error for the model-averaged estimates is computed using equation 4.9 of Burnham and Anderson (2002) if if revised=FALSE; otherwise it uses eq 6.12.
如果包含矩阵名为vcv,然后平均模型的方差 - 协方差矩阵的计算公式伯纳姆和安德森(2002年)第163页。如果没有命名的元素vcv那么就必须有一个元素se其中包含特定机型的标准误差的估计。无条件模型的平均估计标准误差是计算方程4.9伯纳姆和安德森(2002年),要是revised=FALSE,否则它使用EQ 6.12。
值----------Value----------
A list containing elements:
一个列表,其中包含的元素:
参数:estimate
vector of model-averaged estimates <tr valign="top"><td>se</td>
矢量模型的平均估计<tr valign="top"> <TD> se</ TD>
vector of unconditional standard errors (square root of unconditional variance estimator)
无条件的标准误差矢量(无条件方差估计的平方根)
参数:vcv
model-averaged variance-covariance matrix if vcv was specified input list
平均模型的方差 - 协方差矩阵,如果vcv指定的输入列表中
(作者)----------Author(s)----------
Jeff Laake
参考文献----------References----------
and multimodel inference. A practical information-theoretic approach. Springer, New York.
参见----------See Also----------
model.average.marklist
model.average.marklist
实例----------Examples----------
# Create a set of models from dipper data[从北斗星的数据,创建一组模型]
data(dipper)
run.dipper=function()
{
dipper$nsex=as.numeric(dipper$sex)-1
mod1=mark(dipper,groups="sex",
model.parameters=list(Phi=list(formula=~sex)))
mod2=mark(dipper,groups="sex",
model.parameters=list(Phi=list(formula=~1)))
mod3=mark(dipper,groups="sex",
model.parameters=list(p=list(formula=~time),
Phi=list(formula=~1)))
dipper.list=collect.models()
return(dipper.list)
}
dipper.results=run.dipper()
# Extract indices for first year survival from[解压缩指数的第一年生存率]
# Females (group 1) and Males (group 2)[女性(第1组)和男性(第2组)]
Phi.indices=extract.indices(dipper.results[[1]],
"Phi",df=data.frame(group=c(1,2),row=c(1,1),col=c(1,1)))
# Create a matrix for estimates[创建一个矩阵估计]
estimate=matrix(0,ncol=length(Phi.indices),
nrow=nrow(dipper.results$model.table))
# Extract weights for models[提取权重模型]
weight=dipper.results$model.table$weight
# Create an empty list for vcv matrices[创建一个空的列表VCV矩阵]
vcv=vector("list",length=nrow(dipper.results$model.table))
# Loop over each model in model.table for dipper.results[在每个模型中model.table dipper.results循环]
for (i in 1:nrow(dipper.results$model.table))
{
# The actual model number is the row number for the model.table[实际型号的行号的model.table的是]
model.numbers= as.numeric(row.names(dipper.results$model.table))
# For each model extract those real parameter values and their[对于每一个模型中提取那些真正的参数值和其]
# vcv matrix and store them[VCV矩阵,并将其储存]
x=covariate.predictions(dipper.results[[model.numbers[i]]],
data=data.frame(index=Phi.indices))
estimate[i,]=x$estimates$estimate
vcv[[i]]=x$vcv
}
# Call model.average using the list structure which includes[呼叫model.average使用的列表的结构,其中包括]
# estimate, weight and vcv list in this case[在这种情况下的估计,重量和VCV列表]
model.average(list(estimate=estimate,weight=weight,vcv=vcv))
#[]
# Now get same model averaged estimates using model.average.marklist[现在,相同型号的平均估计使用model.average.marklist]
# Obviously this is a much easier approach and what would be used[显然,这是一个更简单的方法,将用于什么]
# if all you are doing is model averaging real parameters in the model.[如果你做的是平均实际模型中的参数模型。]
# The other form is more useful for model averaging[另一种形式是有用的模型平均]
# functions of estimates of the real parameters (eg population estimate)[功能真正的参数估计(例如人口估计)]
#[]
mavg=model.average(dipper.results,"Phi",vcv=TRUE)
print(mavg$estimates[Phi.indices,])
print(mavg$vcv.real[Phi.indices,Phi.indices])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|