fill.covariates(RMark)
fill.covariates()所属R语言包:RMark
Fill covariate entries in MARK design matrix with values
MARK设计矩阵的共变项中填写的值
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Replaces covariate names in design matrix with specific values to compute estimates of real parameters at those values using the dataframe from find.covariates after any value replacement.
在设计矩阵与特定的值替换协变量的名称,在使用数据框find.covariates后的任何值替换这些值计算的实际参数的估计。
用法----------Usage----------
fill.covariates(model, values)
参数----------Arguments----------
参数:model
MARK model object
MARK模型对象
参数:values
a dataframe matching structure of output from find.covariates with the user-defined values entered
输入一个数据框相匹配的产出结构与用户定义的值find.covariates
Details
详细信息----------Details----------
The design matrix for a MARK model with individual covariates contains the covariate names used in the model. In computing the real parameters for the encounter history of an individual it replaces instances of covariate names with the individual covariate values. This function replaces the cells in the design matrix that contain individidual covariates with user-specified values which is an edited version (if needed) of the dataframe returned by find.covariates.
设计一个的MARK模型与个人的变量矩阵中包含的协变量在模型中使用的名称。在计算个人遭遇历史上真正的参数,它取代了协变量的名称与个人的协变量值的实例。此函数替换的单元格中的数据框返回find.covariates这是一个编辑过的版本(如果需要的话)与用户指定的值,包含individidual协变量的设计矩阵。
值----------Value----------
New design matrix with user-defined covariate values entered in place of covariate names
地方协变量的名称与用户定义的协变量值中输入新的设计矩阵
(作者)----------Author(s)----------
Jeff Laake
参见----------See Also----------
find.covariates, compute.real
find.covariates,compute.real
实例----------Examples----------
data(dipper)
dipper$nsex=as.numeric(dipper$sex)-1
dipper$weight=rnorm(294)
#NOTE: This generates random valules for the weights so the answers using[注:为权重,产生随机valules,这样的答案使用]
# ~weight will vary each time it is run[~体重会有所不同,每次运行]
mod=mark(dipper,model.parameters=list(Phi=list(formula=~nsex+weight)))
# Show approach using individual calls to find.covariates, fill.covariates[显示方法,使用单独的调用find.covariates,fill.covariates]
# and compute.real[和compute.real]
fc=find.covariates(mod,dipper)
fc$value[fc$var=="nsex"]=0 # assign sex value to Female[分配性价值的女]
design=fill.covariates(mod,fc) # fill design matrix with values[填写设计矩阵的值]
# compute and output survivals for females at average weight[计算和输出生存率为女性,平均体重]
female.survival=compute.real(mod,design=design)[1,]
female.survival
# Next show same thing with a call to compute.real and a data frame for[下表现出同样的事情的调用到compute.real和一个数据框]
# females and then males[女性和男性]
# compute and output survivals for females at average weight[计算和输出生存率为女性,平均体重]
female.survival=compute.real(mod,data=
data.frame(nsex=0,weight=mean(dipper$weight)))[1,]
female.survival
male.survival=compute.real(mod,data=data.frame(nsex=1,
weight=mean(dipper$weight)))[1,]
male.survival
# Fit model using sex as a group/factor variable and[合适的模型使用一组/因子变量的性别和]
# compute v-c matrix for estimates[计算V-C矩阵的估计]
mod=mark(dipper,groups="sex",
model.parameters=list(Phi=list(formula=~sex+weight)))
survival.by.sex=compute.real(mod,data=dipper,vcv=TRUE)
survival.by.sex$real[1:2] # estimates[估计]
survival.by.sex$se.real[1:2] # std errors[性病的错误]
survival.by.sex$vcv.real[1:2,1:2] # v-c matrix[V-C矩阵]
survival.by.sex$vcv.real[1,2]/prod(survival.by.sex$se.real[1:2])
# sampling correlation of the estimates[抽样估计的相关性]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|