closedpCI.t
and closedpCI.0
functions fit a loglinear model specified by the user and computes the multinomial profile likelihood confidence interval for the adundance estimation. The model can be given as a design matrix mX
or identified trougth arguments m
, h
and theta
. These functions extand closedp.t
and closedp.0
as they broaden the range of model one can fit and they computes confidence interval. Unlike the closedp
functions, it fits only one model at a time.closedpCI.t(X, dfreq=FALSE, m=c("M0","Mt","Mh","Mth"),
h=c("Chao","Poisson","Darroch","Gamma"), theta=2,
mX=NULL, mname, neg=TRUE, alpha=0.05)
closedpCI.0(X, dfreq=FALSE, dtype=c("hist","nbcap"), t, t0=t,
m=c("M0","Mh"), h=c("Chao","Poisson","Darroch","Gamma"),
theta=2, mX=NULL, mname, neg=TRUE, alpha=0.05)
## S3 method for class 'closedpCI':
print(x, \dots)
plotCI(x, ...)
## S3 method for class 'closedpCI':
plotCI(x, main="Profile Likelihood Confidence Interval", \dots)
## S3 method for class 'closedpCI':
boxplot(x, main="Boxplots of Pearson Residuals", \dots)
## S3 method for class 'closedpCI':
plot(x, main="Scatterplot of Pearson Residuals", \dots)
Rcapture-package
for a description of the accepted formats).X
has one row per unit. If TRUE, it indicates that the matrix X
contains frequencies in its last column.X
contains complete observed capture histories. "nbcap" means that X
contains numbers of captures (see
dtype="nbcap"
. A numeric specifying the total number of capture occasions in the experiment.t0
times. By default t0=t
.closedpCI.0
it can be either "M0"=M0 model or "Mh"=Mh model. For closedpCI.t
it can also be "Mt"=Mt model or "Mth"=Mth model.R
function specifying the form of the column for heterogeneity in the design matrix. "Chao" represents Chao's model, "Poisson" represents the function $f(k)=theta^k-1histpos.t
or histpos.0
function.closedpCI.t
function, to print.print.default
, plot.default
or boxplot.default
).X
plot.closedpCI.t
plot.closedpCI.t
t0
argument given in the function call.closedpCI.t
function fits models using the frequencies of the observable capture histories (vector of size $2^t-1$), whereas closedp.0
uses the number of units capture i times, for $i=1,\ldots,t$ (vector of size $t$). Thus, closedpCI.0
can be used with data sets larger than those for closedpCI.t
.
This function does not work for closed population models featuring a behavioral effect, such as Mb and Mbh. The abundance estimation is calculated as the number of captured units plus the exponential of the Poisson regression intercept. However, models with a behavioral effect can by fitted with closedp.t
(Mb and Mbh), closedp.Mtb
and closedp.bc
.
An intercept is added to the model. Therefore, the mX
matrix must not contain a column of ones.
The plotCI.closedpCI
function produces a plot of the multinomial profile likelihood for N. The value of N maximizing the profile likelihood and the bounds of the confidence interval are identified.
The boxplot.closedpCI
function produces a boxplot of the Pearson residuals of the customized model.
The plot.closedpCI
function traces the scatterplot of the Pearson residuals in terms of $f_i$ (number of units captured i times) for the customized model.closedp
, closedp.Mtb
data(hare)
CI<-closedpCI.t(hare, m = "Mth", h = "Poisson", theta = 2)
CI
plotCI(CI)
data(HIV)
mat<-histpos.t(4)
mX2<-cbind(mat,mat[,1]*mat[,2])
closedpCI.t(HIV,dfreq=TRUE,mX=mX2,mname="Mt interaction 1,2")
data(BBS2001)
CI0<-closedpCI.0(BBS2001,dfreq=TRUE,dtype="nbcap",t=50,t0=20,
m="Mh",h="Gamma",theta=3.5)
CI0
plot(CI0)
plotCI(CI0)
### As an alternative to a gamma model, one can fit a negative Poisson model.
### It is appropriate in experiments where very small capture probabilities
### are likely. It can lead to very large estimators of abundance.
data(mvole)
period3<-mvole[,11:15]
psi <- function(x) { 0.5^x - 1 }
closedpCI.t(period3, m = "Mh", h = psi)
Run the code above in your browser using DataLab