extract.indices(RMark)
extract.indices()所属R语言包:RMark
Various utility functions
各种实用功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Miscellaneous set of functions that can be used with results from the package.
杂的功能,可用于从包中的结果集。
用法----------Usage----------
extract.indices(model,parameter,df)
nat.surv(model,df)
pop.est(ns,ps,design,p.vcv)
compute.Sn(x,df,criterion)
logitCI(x,se)
search.output.files(x,string)
参数----------Arguments----------
参数:model
a mark model object
标记的模型对象
参数:parameter
character string for a type of parameter for that model (eg, "Phi","p")
该模型的参数类型的字符串(例如,“披”,“P”)
参数:df
dataframe containing the columns group, row, column which specify the group number, the row number and column number of the PIM
数据框包含的列组,行,列,该列的指定组数,行数和列数的PIM
参数:ns
vector of counts of animals captured
矢量捕获动物的计数
参数:ps
vector of capture probability estimates which match counts
向量的捕获概率的估计相匹配计数
参数:design
design matrix that specifies how counts will be aggregate
设计矩阵,它指定如何计数将总
参数:p.vcv
variance-covariance matrix for capture probability estimates
捕获概率估计的方差 - 协方差矩阵
参数:x
marklist of models for compute.Sn and a vector of real estimates for logitCI
marklist的模型compute.Sn和一个向量的真实估计logitCI
参数:se
vector of std errors for real estimates
真正的估计,性病的错误向量
参数:criterion
vector of model selection criterion values (eg AICc)
在矢量模型选择标准值(例如,国际会议中心)
参数:string
string to be found in output files contained in models in x
在输出文件中被发现字符串中包含的模型在x
Details
详细信息----------Details----------
Function extract.indices extracts the parameter indices from the parameter index matrices (PIMS) for a particular type of parameter that match a set of group numbers and rows and columns that are defined in the dataframe df. It returns a vector of indices which can be used to specify the set of real parameters to be extracted by covariate.predictions using the index column in data or the indices argument. If df is NULL, it returns a dataframe with all of the indices with model.index being the unique index across all parameters and the par.index which is an index to the row in the design data. If parameter is NULL then the the dataframe is given for all of the parameters.
函数extract.indices中提取的参数从参数标号矩阵(PIMS)的指数的一个特定类型的parameter相匹配的一组的组号和所定义的行和列中的数据框df 。它返回一个矢量的指数,它可以被用来指定要被提取的实参数组covariate.predictions在data或indices参数使用索引列。如果df是NULL,则返回一个数据框,所有的索引是唯一索引的所有参数和par.index这是一个指数的设计数据中的行与model.index。如果参数是NULL,则给出的数据框可用于所有的参数。
Function nat.surv produces estimates of natural survival (Sn) from total survival (S) and recovery rate (r) from a joint live-dead model in which all harvest recoveries are reported. In that case, Taylor et al 2005 suggest the following estimator of natural survival Sn=S + (1-S)*r. The arguments for the function are a mark model object and a dataframe df that defines the set of groups and times (row,col) for the natural survival computations. It returns a list with elements: 1) Sn - a vector of estimates for natural survival; one for each entry in df and 2) vcv - a variance-covariance matrix for the estimates of natural survival.
功能nat.surv估计的自然生存期(Sn)的总生存期(S)和恢复率(r)从一个共同的活死的模型中,所有的收获回收率报道。在这种情况下,2005年Taylor等人建议以下估计自然生存型Sn = S +(1-S)*河函数的参数是一个标志model对象和数据框df定义了一组团体和时间(行,列)的自然生存期计算。它返回一个列表的元素:1)Sn - df和2)中的每个条目一个向量的自然生存的估计; vcv - 方差 - 协方差矩阵的估计自然生存。
Function pop.est produces estimates of abundance using a vector of counts of animals captured (ns) and estimates of capture probabilities (ps). The estimates can be aggregated or averaged using the design matrix argument. If individual estimates are needed, use an nxn identity matrix for design where n is the length of ns. To get a total of all the estimates use a nx1 column matrix of 1s. Any other design matrix can be specified to subset, aggregate and/or average the estimates. The argument p.vcv is needed to compute the variance-covariance matrix for the abundance estimates using the formula described in Taylor et al. (2002). The function returns a list with elements: 1) Nhat - a vector of abundance estimates and 2) vcv - variance-covariance matrix for the abundance estimates.
函数pop.est产生丰富的估计,使用矢量动物捕获(ns)的捕获概率的估计(ps)的计数。估计可以汇总或平均使用design矩阵参数。如果个人估计是必要的,使用n×n的单位矩阵的设计,其中n是长度ns。为了得到一个总的估计使用NX1的1列的矩阵。任何其他design矩阵可以指定子集,聚集和/或平均的估计。参数p.vcv的丰度来计算方差 - 协方差矩阵估计在泰勒等人描述的公式。 (2002年)。该函数返回一个列表的内容:1)Nhat的 - 丰富的向量估计2)vcv - 方差 - 协方差矩阵的丰度估计。
Function Compute.Sn creates list structure for natural survival using nat.surv to be used for model averaging natural survival estimates (e.g., model.average(compute.Sn(x,df,criterion))). It returns a list with elements estimates, vcv, weight: 1) estimates - matrix of estimates of natural survival, 2)vcv - list of var-cov matrix for the estimates, and 3) weight - vector of model weights.
函数Compute.Sn创建列表结构的自然生存nat.surv模型平均自然生存期的估计(例如,用于model.average(compute.Sn(x,df,criterion)))。它返回一个列表元素的估计,VCV,重量:1)估计 - 矩阵估计的自然生存期,2)VCV - VAR-CoV的矩阵列表的估计,和3)重量 - 中的权重向量。
Function search.output.filessearches for occurrence of a specific string in output files associated with models in a marklist x. It returns a vector of model numbers in the marklist which have an output file containing the string.
功能search.output.files搜索一个特定的字符串输出文件中的模型于一个marklist x的发生。它返回一个向量的marklist有一个输出文件,其中包含的字符串的型号。
(作者)----------Author(s)----------
Jeff Laake
参考文献----------References----------
MESSIER. 2002. Managing the risk from hunting for the Viscount Melville Sound polar bear population. Ursus 13: 185-202.
D. CLUFF, S. H. FERGUSON, A. ROSING-ASVID, R. SCHWEINSBURG and F. MESSIER. 2005. Demography and viability of a hunted population of polar bears. Arctic 58: 203-214.
实例----------Examples----------
# Example of computing N-hat for occasions 2 to 7 for the p=~time model[例如计算N-场合的帽子2~7为P =~时间模型]
data(dipper)
md=mark(dipper,model.parameters=list(p=list(formula=~time),
Phi=list(formula=~1)))
# Create a matrix from the capture history strings[从捕获的历史字符串创建一个矩阵]
xmat=matrix(as.numeric(unlist(strsplit(dipper$ch,""))),
ncol=nchar(dipper$ch[1]))
# sum number of captures in each column but don't use the first[总结捕获每列数,但不使用第一]
# column because p[1] can't be estimated[列,因为p [1]不能被估计]
ns=colSums(xmat)[-1]
# extract the indices and then get covariate predictions for p(2),...,p(7)[提取指数和协预测P(2),...,P(7)]
# which are row-colums 1-6 in PIM for p[这是行colums 1-6 PIM为p]
p.indices=extract.indices(md,"p",df=data.frame(group=rep(1,6),
row=1:6,col=1:6))
p.list=covariate.predictions(md,data=data.frame(index=p.indices))
# call pop.est using diagonal design matrix to get[打检测pop.est使用对角线设计矩阵]
# separate estimate for each occasion[每次独立估值]
pop.est(ns,p.list$estimates$estimate,
design=diag(1,ncol=6,nrow=6),p.list$vcv)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|