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

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

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

                                        Process encounter history dataframe for MARK analysis
                                         MARK分析的过程中遇到的历史数据框

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

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

Prior to analyzing the data, this function initializes several variables (e.g., number of capture occasions, time intervals) that are often specific to the capture-recapture model being fitted to the data.  It also is used to 1) define groups in the data that represent different levels of one or more factor covariates (e.g., sex), 2) define time intervals between capture occasions (if not 1), and 3) create an age structure for the data, if any.
在分析数据之前,这个函数初始化捕获 - 再捕获模型被嵌合的数据往往是特定的多个变量(例如,数字捕获场合,时间间隔)。它还用于定义组1)中的数据,代表不同级别的一个或多个因素的协变量(例如,性别),2)定义捕获的场合(如果不是1)之间的时间间隔,和3)的年龄结构创建一个的数据,如果有的话。


用法----------Usage----------


  process.data(data, begin.time = 1, model = "CJS",
    mixtures = 1, groups = NULL, allgroups = FALSE,
    age.var = NULL, initial.ages = c(0), age.unit = 1,
    time.intervals = NULL, nocc = NULL,
    strata.labels = NULL, counts = NULL, reverse = FALSE)



参数----------Arguments----------

参数:data
A data frame with at least one field named ch which is the capture (encounter) history stored as a character string. data can also have a field freq which is the number of animals with that capture history. The default structure is freq=1 and it need not be included in the dataframe. data can also contain an arbitrary number of covariates specific to animals with that capture history.
一个数据框至少有一个字段名为ch这是捕获(遭遇)作为字符串存储的历史。 data还可以有一个字段freq这是与捕获历史的动物的数量。默认的结构是频率= 1,它不需要被包括在数据框。 data也可以包含任意数量的协变量的动物,捕捉历史。


参数:begin.time
Time of first capture occasion or vector of times if different for each group
各组不同时间的时候,如果第一次捕捉的场合或矢量


参数:model
Type of analysis model. See mark for a list of possible values for model
分析模型的类型。 markmodel的可能值的列表


参数:mixtures
Number of mixtures in closed capture models with heterogeneity
号码的混合物在封闭的捕获模型的异质性


参数:groups
Vector of factor variable names (in double quotes) in data that will be used to create groups in the data. A group is created for each unique combination of the levels of the factor variables in the list.
矢量因子变量的名称(在双引号)data将被用于创建组的数据。 A组创建水平的因子变量列表中的每个唯一组合。


参数:allgroups
Logical variable; if TRUE, all groups are created from factors defined in groups even if there are no observations in the group
逻辑变量,如果为TRUE,创建组中定义的groups因素,“即使没有观察组中的


参数:age.var
An index in vector groups for a variable (if any) for age
向量groups中的索引变量(如果有的话)的年龄


参数:initial.ages
A vector of initial ages that contains a value for each level of the age variable groups[age.var]
初始年龄的矢量包含一个值,每个级别的年龄变量groups[age.var]


参数:age.unit
Increment of age for each increment of time as defined by time.intervals
增量年龄每增加定义的time.intervals


参数:time.intervals
Vector of lengths of time between capture occasions
向量的捕获之间的时间长度的场合


参数:nocc
number of occasions for Nest type; either nocc or time.intervals must be specified
鸟巢型的场合;,的NOCC或time.intervals必须指定


参数:strata.labels
vector of single character values used in capture history(ch) for ORDMS models; it can contain one more value beyond what is in ch for an unobservable state
单字符值的向量ORDMS采集历史(CH)的模型,它可以包含更多的价值超出了一个不可观测的状态是在CH


参数:counts
named list of numeric vectors (one group) or matrices (>1 group) containing counts for mark-resight models
的数字向量(一组)或矩阵(1组),包含计数标记resight模型的命名列表


参数:reverse
if set to TRUE, will reverse timing of transition (Psi) and survival (S) in Multistratum models
如果设置为TRUE,将扭转时间的过渡(PSI)和存活率(S),多段模型


Details

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

For examples of data, see dipper,edwards.eberhardt,example.data. The structure of the encounter history and the analysis depends on the analysis model to some extent. Thus, it is necessary to process a dataframe with the encounter history (ch) and a chosen model to define the relevant values.  For example, number of capture occasions (nocc) is automatically computed based on the length of the encounter history (ch) in data; however, this is dependent on the type of analysis model.  For models such as "CJS", "Pradel" and others, it is simply the length of ch.  Whereas, for "Burnham" and "Barker" models,the encounter history contains both capture and resight/recovery values so nocc is one-half the length of ch. Likewise, the number of time.intervals depends on the model.  For models, such as "CJS", "Pradel" and others, the number of time.intervals is nocc-1; whereas, for capture&recovery(resight) models the number of time.intervals is nocc. The default time interval is unit time (1) and if this is adequate, the function will assign the appropriate length.  A processed data frame can only be analyzed using the model that was specified.  The model value is used by the functions make.design.data, add.design.data, and make.mark.model to define the model structure as it relates to the data. Thus, if the data are going to be analysed with different underlying models, create different processed data sets with the model name as an extension.  For example, dipper.cjs=process.data(dipper) and dipper.popan=process.data(dipper,model="POPAN").
data的例子,dipper,edwards.eberhardt,example.data。相遇的历史和分析的结构取决于在一定程度上在分析模型上。因此,它是必要的处理数据框与遭遇历史(ch)和一个选择model定义相关的值。例如,数目捕获的场合(nocc)自动计算的基础上的长度的相遇历史(ch)data;然而,这是依赖于分析模型的类型。如“CJS”,“普拉德尔”和其他的模型,它的长度ch。然而,“伯纳姆”和“巴克”的模型,遭遇历史都的捕获和resight /恢复值,所以nocc是一个长度的一半ch。同样,time.intervals视型号而定。模式,如“CJS”,“普拉德尔”和其他数time.intervals是nocc-1;,而用于捕获和的恢复(resight)型号的数量time.intervals的是nocc。默认的时间间隔是单位时间(1),如果这是适当的,该函数将分配适当的长度。处理的数据框只能使用指定的模型,分析。 model值的函数所使用make.design.data,add.design.data和make.mark.model来定义模型的结构,因为它涉及到的数据。因此,如果数据是要与不同的基础模型进行分析,创建不同的处理后的数据集作为一个扩展的模型名称。例如,dipper.cjs=process.data(dipper)的和dipper.popan=process.data(dipper,model="POPAN")。

This function will report inconsistencies in the lengths of the capture history values and when invalid entries are given in the capture history. For example, with the "CJS" model, the capture history should only contain 0 and 1 whereas for "Barker" it can contain 0,1,2.  For "Multistrata" models, the code will automatically identify the number of strata and strata labels based on the unique alphabetic codes used in the capture histories.
这个函数将捕获的历史值的长度的和无效的输入时,在捕获历史报告的不一致。例如,“CJS”的模式,捕捉历史应该只包含0和1,而“巴克”,它可以包含0,1,2。 “多层次”的模式,代码会自动识别独特的字母代码,用于捕捉历史的基础上阶层和阶层标签的数量。

The argument begin.time specifies the time for the first capture occasion.  This is used in creating the levels of the time factor variable in the design data and for labelling parameters. If the begin.time varies by group, enter a vector of times with one for each group. Note that the time values for survivals are based on the beginning of the survival interval and capture probabilities are labeled based on the time of the capture occasion.  Likewise, age labels for survival are the ages at the beginning times of the intervals and for capture probabilities it is the age at the time of capture/recapture.
参数begin.time指定的时间第一次捕捉机会。这是用于创建的时间因子的水平的设计数据中的变量和参数,用于标识。如果begin.time不同的组,各组输入矢量次。请注意,为存活时间值的基础上开始的生存区间和捕获概率被标记的时间的基础上的捕获的场合。同样,年龄标签为生存的年龄开始时间的时间间隔,捕获概率,它的年龄是在时间捕捉/夺回。

groups is a vector of variable names that are contained in data.  Each must be a factor variable. A group is created for each unique combination of the levels of the factor variables.  In the first example given below groups=c("sex","age","region"). which creates groups defined by the levels of sex, age and region. There should be 2(sexes)*3(ages)*4(regions)=24 groups but in actuality there are only 16 in the data because there are only 2 age groups for each sex. Age group 1 and 2 for M and age groups 2 and 3 for F.  This was done to demonstrate that the code will only use groups that have 1 or more capture histories unless allgroups=TRUE.
groups是一个向量的变量名称中所包含的data。每个人都必须是一个因素变量。 A组创建的每个唯一组合的因子变量的层次。在第一个例子,下面给出groups=c("sex","age","region")。创建一组定义的水平sex,age和region。应该有2人(男女)* 3(年龄)* 4 = 24组(区域),但实际上只有16中的数据,因为只有2个年龄组,每个性别。年龄组1和2 M和年龄组2和3楼,这样做是为了证明该代码将只能使用组中有1个或多个捕获的历史,除非allgroups=TRUE。

The argument age.var=2 specifies that the second grouping variable in groups represents an age variable.  It could have been named something different than age. If a variable in groups is named age then it is not necessary to specify age.var. initial.age specifies that the age at first capture of the age levels is 0,1 and 2 while the age classes were designated as 1,2,3. The actual ages for the age classes do not have to be sequential or ordered, but ordering will cause less confusion.  Thus levels 1,2,3 could represent initial ages of 0,4,6 or 6,0,4. The argument age.unit is the amount an animal ages for each unit of time and the default is 1.  The default for initial.age is 0 for each group, in which case, age represents time since marking (first capture) rather than the actual age of the animal.
参数age.var=2指定在groups第二个分组变量代表一个时代的变量。它可以被命名为不同年龄的东西。如果一个变量在groups名为age那么就没有必要指定age.var。 initial.age规定,在第一次捕捉岁的年龄层为0,1和2岁,而类被指定为1,2,3。年龄阶层的实际年龄不应该是有序的,或者责令,但订货会导致混乱。因此,各级1,2,3代表初始年龄为0,4,6或6,0,4。的的参数age.unit是量的动物年龄,每个单位时间的默认值是1。的默认值initial.age是各组中为0,在这种情况下,age标记的时间,因为第一次捕捉的动物,而不是实际年龄。


值----------Value----------

processed.data (a list with the following elements)
processed.data(包含下列元素的列表)


参数:data
original raw dataframe with group factor variable added if groups were defined  <tr valign="top"><td>model</td>
最初的原始数据框组因子变量如果被定义<tr valign="top"> <TD>model</ TD>

type of analysis model (eg, "CJS", "Burnham", "Barker")
分析模型的类型(例如,“CJS”,“伯纳姆”,“巴克”)


参数:freq
a dataframe of frequencies (same number of rows as data, number of columns is the number of groups in the data. The column names are the group labels representing the unique groups that have one or more capture histories.  <tr valign="top"><td>nocc</td>
一个数据框的频率(相同的行数,列数的数据组数列名的组标签的独特的群体,有一个或多个捕获的历史。<TR VALIGN =“顶” > <TD> nocc</ TD>

number of capture occasions  <tr valign="top"><td>time.intervals</td>
数捕获的场合<tr valign="top"> <TD> time.intervals</ TD>

length of time intervals between capture occasions  <tr valign="top"><td>begin.time</td>
长的时间间隔之间捕获的场合<tr valign="top"> <TD>begin.time</ TD>

time of first capture occasion  <tr valign="top"><td>age.unit</td>
第一次捕捉机会的时间<tr valign="top"> <TD>age.unit</ TD>

increment of age for each increment of time  <tr valign="top"><td>initial.ages</td>
增量的年龄每增加<tr valign="top"> <TD>initial.ages</ TD>

an initial age for each group in the data; Note that this is not the original argument but is a vector with the initial age for each group. In the first example below proc.example.data$initial.ages is a vector with 16 elements as follows 0 1 1 2 0 1 1 2 0 1 1 2 0 1 1 2
中的每个组的初始年龄数据;注意,这是不是原来的参数,但是一个向量,与为每个组的初始年龄。在第一个例子下面的proc.example.data$initial.ages是一个16个元素的向量,如下:0 1 1 2 0 1 1 2 0 1 1 2 0 1 1 2


参数:nstrata
number of strata in Multistrata models
在多层次模型的阶层数


参数:strata.labels
vector of alphabetic characters used to identify strata in Multistrata models
矢量字母字符识别阶层在多层次模型


参数:group.covariates
factor covariates used to define groups
因子协变量用来定义组


(作者)----------Author(s)----------



Jeff Laake




参见----------See Also----------

import.chdata, dipper, edwards.eberhardt, example.data
import.chdata,dipper,edwards.eberhardt,example.data


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


data(example.data)
proc.example.data=process.data(data=example.data,begin.time=1980,
groups=c("sex","age","region"),
age.var=2,initial.age=c(0,1,2))

data(dipper)
dipper.process=process.data(dipper)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-23 23:06 , Processed in 0.030774 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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