weta(RMark)
weta()所属R语言包:RMark
Occupancy data for Mahoenui Giant Weta
占用数据的Mahoenui巨威塔
译者:生物统计家园网 机器人LoveR
描述----------Description----------
An occupancy data set for modelling presence/absence data for salamanders.
的占用数据集建模山椒的存在/不存在的数据。
格式----------Format----------
A data frame with 72 observations (sites) on the following 7
一个数据框72意见(场)对以下7个
ch a character vector containing the presence
CH字符向量存在
Browse 0/1 dummy variable to indicate browsing
浏览0/1个虚拟变量来表示浏览
Obs1 observer
OBS1观察员
Obs2 observer
OBS2观察员
Obs3 observer
Obs3观察员
Obs4 observer
Obs4观察员
Obs5 observer
Obs5观察员
Details
详细信息----------Details----------
This is a data set that accompanies program PRESENCE and is explained on pages 116-122 of MacKenzie et al. (2006).
这是一个数据集,伴随着节目存在,并解释Mackenzie等人116-122页。 (2006年)。
参考文献----------References----------
K.H., Bailey, L.L., and Hines, J.E. 2006. Occupancy Estimation and Modeling: Inferring Patterns and Dynamics of Species Occurence. Elsevier, Inc. 324p.
实例----------Examples----------
# The data can be imported with the following command using the[数据可以用下面的命令使用进口]
# tab-delimited weta.txt file in the data subdirectory.[制表符分隔的weta.txt的数据子目录中的文件。]
# weta=import.chdata("weta.txt",field.types=c(rep("f",6)))[沙螽import.chdata(“weta.txt”,field.types = C(代表“F”,(6)))]
# Below is the first few lines of the data file that was constructed[下面是第几行的数据文件,构建]
# from the .xls file that accompanies PRESENCE.[从伴随PRESENCE。xls文件。]
#ch Browse Obs1 Obs2 Obs3 Obs4 Obs5[CH浏览OBS1 OBS2 Obs3 Obs4 Obs5]
#0000. 1 1 3 2 3 .[0000。 1 1 3 2 3。]
#0000. 1 1 3 2 3 .[0000。 1 1 3 2 3。]
#0001. 1 1 3 2 3 .[0001。 1 1 3 2 3。]
#0000. 0 1 3 2 3 .[0000。 0 1 3 2 3。]
#0000. 1 1 3 2 3 .[0000。 1 1 3 2 3。]
#0000. 0 1 3 2 3 .[0000。 0 1 3 2 3。]
#[]
# retrieve weta data[检索维塔数据]
data(weta)
# Create function to fit the 18 models in the book[在书中,创建功能,以适应18款]
fit.weta.models=function()
{
# use make.time.factor to create time-varying dummy variables Obs1 and Obs2[使用make.time.factor创建虚拟变量随时间变化的OBS1 OBS2]
# observer 3 is used as the intercept[观察者3用作截距]
weta=make.time.factor(weta,"Obs",1:5,intercept=3)
# Process data and use Browse covariate to group sites; it could have also[过程数据和使用浏览协集团网站,它可能也有]
# been used an individual covariate because it is a 0/1 variable.[被用于一个单独的协变量,因为它是一个0/1变量。]
weta.process=process.data(weta,model="Occupancy",groups="Browse")
weta.ddl=make.design.data(weta.process)
# time factor variable copied to Day to match names used in book[复制到一天的时间因素变量,用于书籍的名称相匹配]
weta.ddl$p$Day=weta.ddl$p$time
# Define p models[定义P型]
p.dot=list(formula=~1)
p.day=list(formula=~Day)
p.obs=list(formula=~Obs1+Obs2)
p.browse=list(formula=~Browse)
p.day.obs=list(formula=~Day+Obs1+Obs2)
p.day.browse=list(formula=~Day+Browse)
p.obs.browse=list(formula=~Obs1+Obs2+Browse)
p.day.obs.browse=list(formula=~Day+Obs1+Obs2+Browse)
# Define Psi models[定义幽模式]
Psi.dot=list(formula=~1)
Psi.browse=list(formula=~Browse)
# Create model list[创建模型列表]
cml=create.model.list("Occupancy")
# Run and return marklist of models[运行并返回marklist的车型]
return(mark.wrapper(cml,data=weta.process,ddl=weta.ddl))
}
weta.models=fit.weta.models()
# Modify the model table to show -2lnl and use AIC rather than AICc[修改模型表显示2lnl和使用AIC,而不是国际会议中心]
weta.models$model.table=model.table(weta.models,use.AIC=TRUE,use.lnl=TRUE)
# Show new model table which duplicates the results except they have[显示新的模型表,除非他们有重复的结果]
# some type of error with the model Psi(.)P(Obs+Browse) which should have[某些类型的错误与模型PSI()P(OBS +浏览)里面应该有]
# 5 parameters rather than 4 and the -2lnl also doesn't agree with the results here[5个参数,而不是4和2lnl的也不会同意的结果]
weta.models
#[]
# display beta vcv matrix of the Psi parameters (intercept + browse=1)[显示测试VCV的PSI参数矩阵(截+浏览= 1)]
# matches what is shown on pg 122 of Occupancy book[比赛是什么占用书页122]
weta.models[[7]]$result$beta.vcv[8:9,8:9]
# compute variance-covariance matrix of Psi0(6; unbrowsed) ,Psi1(7; browsed)[计算方差 - 协方差矩阵的Psi0成为(6; unbrowsed的),PSI1(7浏览)。]
vcv.psi=get.real(weta.models[[7]],"Psi",vcv=TRUE)$vcv.real
vcv.psi
# Compute proportion unbrowsed and browsed[计算比例unbrowsed浏览]
prop.browse=c(37,35)/72
prop.browse
# compute std error of overall estimate as shown on pg 121-122[计算STD的总体估计误差对PG 121-122]
sqrt(sum(prop.browse^2*diag(vcv.psi)))
# compute std error and correctly include covariance between Psi0 and Psi1[计算STD错误的和正确地包含Psi0成为之间的协方差和PSI1]
sqrt( t(prop.browse) %*% vcv.psi %*% prop.browse )
# show missing part of variance 2 times cross-product of prop.browse * covariance[显示缺少的一部分方差跨产品的2倍prop.browse *协方差]
2*prod(prop.browse)*vcv.psi[1,2]
sqrt(sum(prop.browse^2*diag(vcv.psi))+2*prod(prop.browse)*vcv.psi[1,2])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|