Learn R Programming

RMark (version 2.1.1)

find.covariates: Find covariates in MARK design matrix

Description

Finds and extracts cells in MARK design matrix containing covariates. Computes mean values of the covariates and assigns those as default values. Returns dataframe that can be edited to replace default values which are then inserted into the design matrix with fill.covariates to enable computation of estimates of real parameters with compute.real.

Usage

find.covariates(model, data = NULL, usemean = TRUE)

Arguments

model
MARK model object
data
dataframe used to construct MARK model object; not processed data list
usemean
logical; if TRUE uses mean value of covariate for default and otherwise uses 0

Value

  • A dataframe with the following fields
  • rnamesname of real parameter
  • rowrow number in design matrix (equivalent to parm.indices in call to compute.real
  • colcolumn number in design matrix
  • varname of covariate
  • valuevalue for covariate

Details

The design matrix for a MARK model with individual covariates contains entries with the covariate names used in the model. In computing the real parameters for the encounter history of an individual it replaces instances of covariate names with the individual covariate values. This function finds all of the cells in the design matrix that contain individidual covariates and constructs a dataframe of the name of the real parameter, the position (row, col) in the design matrix and a default value for the covariate. The default field value is assigned to one of three values in the following priority order: 1) the mean value for the covariates in data (if data is not NULL), 2) the mean values used in the MARK output (if data=NULL,usemean=TRUE), 3) 0 (if usemean=FALSE and data=NULL). The values can also be modified using fc=edit(fc) where fc is the value from this function.

See Also

fill.covariates, compute.real

Examples

Run this code
# see examples in fill.covariates

Run the code above in your browser using DataLab