find.covariates: Find covariates in MARK design matrix

View source: R/find.covariates.R

find.covariatesR Documentation

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

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.

Value

A dataframe with the following fields

rnames

name of real parameter

row

row number in design matrix (equivalent to parm.indices in call to compute.real

col

column number in design matrix

var

name of covariate

value

value for covariate

Author(s)

Jeff Laake

See Also

fill.covariates, compute.real

Examples


# see examples in fill.covariates


RMark documentation built on Aug. 14, 2022, 1:05 a.m.

Related to find.covariates in RMark...