Learn R Programming

mra (version 2.16.11)

predict.cjs: predict.cjs

Description

Predictor method for CJS capture-recapture objects. Return expected values for all active cells in the model.

Usage

# S3 method for cjs
predict(object, ...)

Arguments

object

CJS capture-recapture model as output from F.cjs.estim

Additional arguments to other functions. Not used, but must be here for compatibility with the generic predict function.

Value

A nan X ns matrix of fitted values (=cell expected value), where nan=number of animals and ns=number of samples. Fitted values in the non-active cells are set to NA. Non-active cells are those prior to and including the initial capture, and after the occasion on which an animal is known to have died. Computation of expected values is described in the details section of the help file for F.cjs.gof.

Details

The only components of cjsobj needed are $histories, $p.hat, $s.hat

See Also

F.cjs.estim, F.cjs.gof

Examples

Run this code
# NOT RUN {
# Fit CJS model to dipper data, time-varying capture and survivals.
data(dipper.histories)
xy <- F.cjs.covars( nrow(dipper.histories), ncol(dipper.histories) )
for(j in 1:ncol(dipper.histories)){ assign(paste("x",j,sep=""), xy$x[,,j]) } 
dipper.cjs <- F.cjs.estim( ~x2+x3+x4+x5+x6, ~x1+x2+x3+x4+x5, dipper.histories )
dipper.expected <- predict(dipper.cjs)

# }

Run the code above in your browser using DataLab