F.cr.model.matrix(capture, survival, nan, ns)ivar and tvar functions to work. Normally, nan =
number of rows in capture history matrix. No default value.ns = number of
columns in the capture history matrix.nrow(x) where x is a 2-D matrix in the model (i.e.,
number of animals). NS = ncol(x) (i.e., number of capture occasions).
NX = number of matrices specified in the model. IX = 1 if an intercept is included,
0 otherwise. The j-th covariate matrix specified in the model can be accessed directly with
capX[, IX+1+(NS*(j-1)):(NS*j) ].nrow(x) where y is a 2-D matrix in the model (i.e.,
number of animals). NS = ncol(y) (i.e., number of capture occasions).
NY = number of matrices specified in the model. IY = 1 if an intercept is included,
0 otherwise. The j-th covariate matrix specified in the model can be accessed directly with
capY[, IY+1+(NS*(j-1)):(NS*j) ].eval with a model frame, and calls the
R internal model.matrix to
resolve the matrices in the formula. All matrices specified in the models
should be in the current scope and accessible to both eval and model.matrix.
This routine calls F.3d.model.matrix twice. F.3d.model.matrix
does all the work.F.cjs.estim, model.matrix, eval# Synthetic example with 10 animals and 5 occasions
nan <- 10
ns <- 5
sex <- matrix( as.numeric(runif( nan ) > 0.5), nrow=nan, ncol=ns )
x <- matrix( runif( nan*ns ) , nrow=nan, ncol=ns )
F.cr.model.matrix( capture= ~ sex + x, survival= ~ -1 + x, nan, ns )Run the code above in your browser using DataLab