mstrata(RMark)
mstrata()所属R语言包:RMark
Multistrata example data
多层次的示例数据
译者:生物统计家园网 机器人LoveR
描述----------Description----------
An example data set which appears to be simulated data that accompanies MARK as an example analysis using the Multistrata model.
这似乎是模拟数据,伴随着MARK为例进行分析,使用多层次模型的示例数据集。
格式----------Format----------
A data frame with 255 observations on the following 2 variables.
一个数据框有255个观察以下2个变量。
ch a character vector containing the encounter history of
CH字符向量的遭遇史上的
freq the number of birds with that capture
频率,捕捉鸟类的数量
Details
详细信息----------Details----------
This is a data set that accompanies program MARK as an example for the Multistrata model. The models created by RMark are all "Parm-specific" models by default. The sin link is not allowed because all models are specified via the design matrix. Although you can set links for the parameters, usually the default values are preferable. See make.mark.model for additional help building formula for Psi using the remove.intercept argument.
这是一个数据集,伴随着计划MARK的多层次模型的一个例子。的模型创建的RMark的所有默认情况下,“省,自治区,直辖市特定的”模型。罪链接是不允许的,因为所有型号都通过指定的设计矩阵。虽然你可以设置的参数,通常默认值是可取的。见make.mark.model额外的帮助建设PSI使用remove.intercept参数的计算公式。
实例----------Examples----------
data(mstrata)
run.mstrata=function()
{
#[]
# Process data[过程数据]
#[]
mstrata.processed=process.data(mstrata,model="Multistrata")
#[]
# Create default design data[创建默认的设计数据]
#[]
mstrata.ddl=make.design.data(mstrata.processed)
#[]
# Define range of models for S; note that the betas will differ from the output[定义范围型号为S;注意的beta将不同于输出]
# in MARK for the ~stratum = S(s) because the design matrix is defined using[MARK~阶层= S(S),因为设计矩阵定义]
# treatment contrasts for factors so the intercept is stratum A and the other[治疗对比的因素,因此拦截阶层和其他]
# two estimates represent the amount that survival for B abd C differ from A.[两个估计量生存的B ABDÇ不同A.]
# You can use force the approach used in MARK with the formula ~-1+stratum which[您可以使用武力MARK~(-1)+层的公式中使用的方法]
# creates 3 separate Betas - one for A,B and C.[创建3个独立的测试版 - 一个为A,B和C。]
#[]
S.stratum=list(formula=~stratum)
S.stratumxtime=list(formula=~stratum*time)
#[]
# Define range of models for p[定义范围内的车型为p]
#[]
p.stratum=list(formula=~stratum)
#[]
# Define range of models for Psi; what is denoted as s for Psi[psi的,还有的是为幽记为S模型的定义范围]
# in the Mark example for Psi is accomplished by -1+stratum:tostratum which[在psi的是通过-1 +层的标记示例:tostratum]
# nests tostratum within stratum. Likewise, to get s*t as noted in MARK you[巢tostratum内地层。同样,s * t的注意在标记你]
# want ~-1+stratum:tostratum:time with time nested in tostratum nested in[想~(-1)+阶层:tostratum:tostratum嵌套在嵌套随着时间的推移]
# stratum.[阶层。]
#[]
Psi.s=list(formula=~-1+stratum:tostratum)
Psi.sxtime=list(formula=~-1+stratum:tostratum:time)
#[]
# Create model list and run assortment of models[创建模型列表和运行各式各样的模型]
#[]
model.list=create.model.list("Multistrata")
#[]
# Add on specific models that are paired with fixed p's to remove confounding[加具体型号,搭配固定的p除去混杂]
#[]
p.stratumxtime=list(formula=~stratum*time)
p.stratumxtime.fixed=list(formula=~stratum*time,fixed=list(time=4,value=1))
model.list=rbind(model.list,c(S="S.stratumxtime",p="p.stratumxtime.fixed",
Psi="Psi.sxtime"))
model.list=rbind(model.list,c(S="S.stratum",p="p.stratumxtime",Psi="Psi.s"))
#[]
# Run the list of models[运行列表模型]
#[]
mstrata.results=mark.wrapper(model.list,data=mstrata.processed,ddl=mstrata.ddl,threads=2)
#[]
# Return model table and list of models[回归模型的表格和列表的车型]
#[]
return(mstrata.results)
}
mstrata.results=run.mstrata()
mstrata.results
# Example of reverse Multistratum model[反向多段模式示例]
data(mstrata)
mod=mark(mstrata,model="Multistrata")
mod.rev=mark(mstrata,model="Multistrata",reverse=TRUE)
Psilist=get.real(mod,"Psi",vcv=TRUE)
Psilist.rev=get.real(mod.rev,"Psi",vcv=TRUE)
Psivalues=Psilist$estimates
Psivalues.rev=Psilist.rev$estimates
TransitionMatrix(Psivalues[Psivalues$time==1,])
TransitionMatrix(Psivalues.rev[Psivalues.rev$occ==1,])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|