unmarkedFrameMPois(unmarked)
unmarkedFrameMPois()所属R语言包:unmarked
Organize data for the multinomial-Poisson mixture model of Royle (2004)
组织多项泊松混合模型的罗伊尔(2004年数据)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Organizes count data along with the covariates. This S4 class is required by the data argument of
组织数数据的协变量。 S4类的数据参数
用法----------Usage----------
参数----------Arguments----------
参数:y
An RxJ matrix of count data, where R is the number of sites (transects) and J is the maximum number of observations per site.
一种RXJ计数数据的矩阵,其中R是网站(断面)的数目和J的最大数量是每个站点的观测。
参数:siteCovs
A data.frame of covariates that vary at the site level. This should have R rows and one column per covariate
Adata.frame在站点级别的不同的协变量。这应该有R行和一列的每协变量
参数:obsCovs
Either a named list of RxJ data.frames or a data.frame with RxJ rows and one column per covariate. For the latter format, the covariates should be in site-major order.
一个命名RXJdata.frame的列表或data.frameRXJ行一列,每协。对于后者的格式,协变量应该是在主要站点的秩序。
参数:type
Either "removal" or "double" for removal sampling or double observer sampling. If this argument not specified, the user must provide an obsToY matrix. See details.
无论是“清除”或“双”去除采样或双观察员的采样。如果该参数没有指定,则用户必须提供一个obsToY矩阵。查看详细信息。
参数:obsToY
A matrix describing the relationship between obsCovs and y. This is necessary because under some sampling designs the dimensions of y do not equal the dimensions of each observation level covariate. For example, in double observer sampling there are 3 observations (seen only by observer A, detected only by observer B, and detected by both), but each observation-level covariate can only have 2 columns, one for each observer. This matrix is created automatically if type is either "removal" or "double".
一个矩阵描述的关系obsCovs和y。这是必要的,因为在某些采样y的尺寸不等于各观测协的尺寸设计。例如,在双观察员抽样有3观测(只看到观察员甲,只观察员乙检测,并检测两个),但每个观察水平协变量只能有2个列,一个用于每个观察者。这个矩阵自动创建type是“清除”或“双”。
参数:mapInfo
Currently ignored
目前被忽略
参数:piFun
Function used to compute the multinomial cell probabilities from a matrix of detection probabilities. This is created automatically if type is either "removal" or "double". </table>
函数,用于计算多项式的单元从一个矩阵的检测概率的概率。这是自动创建type是“清除”或“双”。 </ TABLE>
Details
详细信息----------Details----------
unmarkedFrameMPois is the S4 class that holds data to be passed
unmarkedFrameMPois是S4的类,用于保存数据传递
值----------Value----------
an object of class unmarkedFrameMPois
对象的类unmarkedFrameMPois的
参考文献----------References----------
count survey data. Animal Biodiversity and Conservation, 27(1), 375-386.
参见----------See Also----------
unmarkedFrame-class, unmarkedFrame,
unmarkedFrame-class,unmarkedFrame,
实例----------Examples----------
# Fake doulbe observer data[假doulbe观察员数据]
R <- 4 # number of sites[一些网站]
J <- 2 # number of observers[一些观察家]
y <- matrix(c(
1,0,3,
0,0,0,
2,0,1,
0,0,2), nrow=R, ncol=J+1, byrow=TRUE)
y
site.covs <- data.frame(x1=1:4, x2=factor(c('A','B','A','B')))
site.covs
obs.covs <- list(
x3 = matrix(c(
-1,0,
-2,0,
-3,1,
0,0),
nrow=R, ncol=J, byrow=TRUE),
x4 = matrix(c(
'a','b',
'a','b',
'a','b',
'a','b'),
nrow=R, ncol=J, byrow=TRUE))
obs.covs
# Create unmarkedFrame[创建unmarkedFrame]
umf <- unmarkedFrameMPois(y=y, siteCovs=site.covs, obsCovs=obs.covs,
type="double")
# The above is the same as:[以上是相同的:]
o2y <- matrix(1, 2, 3)
pifun <- function(p)
{
M <- nrow(p)
pi <- matrix(NA, M, 3)
pi[, 1] <- p[, 1] * (1 - p[, 2])
pi[, 2] <- p[, 2] * (1 - p[, 1])
pi[, 3] <- p[, 1] * p[, 2]
return(pi)
}
umf <- unmarkedFrameMPois(y=y, siteCovs=site.covs, obsCovs=obs.covs,
obsToY=o2y, piFun="pifun")
# Fit a model[拟合模型]
fm <- multinomPois(~1 ~1, umf)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|