View source: R/find.covariates.R
find.covariates | R Documentation |
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
.
find.covariates(model, data = NULL, usemean = TRUE)
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 |
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.
A dataframe with the following fields
rnames |
name of real parameter |
row |
row number in design matrix (equivalent to
|
col |
column number in design matrix |
var |
name of covariate |
value |
value for covariate |
Jeff Laake
fill.covariates
, compute.real
# see examples in fill.covariates
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.