找回密码
 注册
查看: 724|回复: 0

R语言 RMark包 killdeer()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-26 23:43:00 | 显示全部楼层 |阅读模式
killdeer(RMark)
killdeer()所属R语言包:RMark

                                        Killdeer nest survival example data
                                         基尔迪尔巢生存的示例数据

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

A data set on killdeer that accompanies MARK as an example analysis for the nest survival model.
一个数据集上基尔迪尔,伴随着MARK为巢的生存模型为例进行分析。


格式----------Format----------

A data frame with 18 observations on the following 6 variables.
18以下6个变量的观察数据框。




id a MARK comment field with a nest id
一个标记注释字段ID与一个窝ID




FirstFound the day the nest was first found
FirstFound日在鸟巢首次被发现

  


LastPresent the
LastPresent的

  


LastChecked the last day the nest
LastChecked最后一天的窝

  


Fate the fate of the nest; 0=hatch and 1 depredated
命运的命运之巢0 =孵化和1 depredated的




Freq the frequency of nests with this data; usually 1
巢与此数据的频率的频率通常为1;


Details

详细信息----------Details----------

This is a data set that accompanies program MARK as an example for nest survival. The data structure for the nest survival model is completely different from the capture history structure used for most MARK models.  To cope with these data you must import them into a dataframe using R commands and assign the specific variable names shown above. The id and Freq fields are optional.  Freq is assumed to be 1 if not given.  You cannot import the MARK .inp file structure directly into R without some manipulation.  Also note that import.chdata and convert.inp do NOT work for nest survival data. In the examples section below, the first section of code provides an example of converting the killdeer.inp file into a dataframe for RMark.
这是一个数据集,伴随着计划MARK巢生存的一个例子。巢生存模型的数据结构从捕获历史最MARK模型用于结构是完全不同的。为了应付这些数据,你必须将它们导入到一个数据框使用R命令,并指定特定的变量名称。 id和频率领域都是可选的。频率被假定为1,如果没有给出。直接到R没有一些操作,你不能导入的标志。inp文件结构。另外请注意,import.chdata和convert.inp不工作的巢生存数据。在下面的例子中,代码的第一部分提供了一个例子的转换的killdeer.inp的文件到一个数据框RMark。

If your dataframe contains a variable AgeDay1, which is the age of the nest on the first occasion then you can use a variable called NestAge which will create a set of time-dependent covariates named NestAge1,NestAge2 ...NestAge(nocc-1) which will provide a way to incorporate the age of the nest in the model.  This was added because the age covariate in the design data for S assumes all nests are the same age and is not particularly useful. This effect could be incorporated by using the add() function in the design matrix but RMark does not have any capability for doing that and it is easier to create a time-dependent covariate to do the same thing.
如果你的数据框包含一个的变量AgeDay1,这是时代的巢上的第一次,那么你可以使用一个变量称为NestAge的将创建一组随时间变化的协变量命名为NestAge1,NestAge2 NestAge(NOCC-1)这将提供一个方法,将之巢的年龄在模型中。这是因为年龄协变量的设计为S的数据假设所有的巢是相同的年龄,是不是特别有用。这个效果可以合并使用的add()函数在设计矩阵,但RMark没有任何能力这样做,很容易创建一个随时间变化的协变量做同样的事情。


实例----------Examples----------



# EXAMPLE CODE FOR CONVERSION OF .INP TO NECESSARY DATA STRUCTURE[示例代码。INP必要的数据结构的转换]
# read in killdeer.inp file[阅读killdeer.inp文件]
#killdeer=scan("killdeer.inp",what="character",sep="\n")[基尔迪尔扫描(“killdeer.inp”,什么“字”,SEP =“\ n”)]
# strip out ; and write out all but first 2 lines which contain comments[去掉,并写出所有,但第2行包含注释]
#write(sub(";","",killdeer[3:20]),"killdeer.txt")[写(子(“,”,“”,基尔迪尔[3:20]),“killdeer.txt”)]
# read in as a dataframe and assign names[阅读作为一个数据框,并指定名称]
#killdeer=read.table("killdeer.txt")[基尔迪尔= read.table(“killdeer.txt”)]
#names(killdeer)=c("id","FirstFound","LastPresent","LastChecked","Fate","Freq")[名(基尔迪尔)= C(“ID”,“FirstFound”,“LastPresent”,“LastChecked”,“命运”,“频率”)]
#[]
# EXAMPLE CODE TO RUN MODELS CONTAINED IN THE MARK KILLDEER.DBF[示例代码包含的中的MARK KILLDEER.DBF的运行模型]
data(killdeer)
# produce summary[生成汇总]
summary(killdeer)
# Define function to run models that are in killdeer.dbf[定义函数来运行模式,是在killdeer.dbf]
# You must specify either the number of occasions (nocc) or the time.intervals[您必须指定一些场合(NOCC)或time.intervals的]
# between the occasions.[之间的场合。]
run.killdeer=function()
{
   Sdot=mark(killdeer,model="Nest",nocc=40)
   STime=mark(killdeer,model="Nest",
       model.parameters=list(S=list(formula=~I(Time+1))),nocc=40,threads=2)
   STimesq=mark(killdeer,model="Nest",
       model.parameters=list(S=list(formula=~I(Time+1)+I((Time+1)^2))),nocc=40,threads=2)
   STime3=mark(killdeer,model="Nest",
      model.parameters=list(S=list(formula=~I(Time+1)+I((Time+1)^2)+I((Time+1)^3))),nocc=40,threads=2)
   return(collect.models())
}
# run defined models[运行定义模型]
killdeer.results=run.killdeer()


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-4-19 17:25 , Processed in 0.059101 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表