compute.design.data: Compute design data for a specific parameter in the MARK...

View source: R/compute.design.data.R

compute.design.dataR Documentation

Compute design data for a specific parameter in the MARK model (internal use)

Description

For a specific type of parameter (e.g., Phi, p, r etc), it creates a data frame containing design data for each parameter of that type in the model as structured by an all different PIM (parameter information matrix). The design data are used in constructing the design matrix for MARK with user-specified model formulae as in make.mark.model.

Usage

compute.design.data(
  data,
  begin,
  num,
  type = "Triang",
  mix = FALSE,
  rows = 0,
  pim.type = "all",
  secondary,
  nstrata = 1,
  tostrata = FALSE,
  strata.labels = NULL,
  subtract.stratum = strata.labels,
  common.zero = FALSE,
  sub.stratum = 0,
  limits = NULL,
  events = NULL,
  use.events = NULL,
  mscale = 1,
  subtract.events = NULL
)

Arguments

data

data list created by process.data

begin

0 for survival type, 1 for capture type

num

number of parameters relative to number of occasions (0 or -1)

type

type of parameter structure (Triang (STriang) or Square)

mix

if TRUE this is a mixed parameter

rows

number of rows relative to number of mixtures

pim.type

type of pim structure; either all (all-different) or time

secondary

TRUE if a parameter for the secondary periods of robust design

nstrata

number of strata for multistrata

tostrata

set to TRUE for transition parameters

strata.labels

labels for strata as identified in capture history

subtract.stratum

for each stratum, the to.strata that is computed by subtraction or for HidMarkov it is the strata computed by subtraction for pi parameter

common.zero

if TRUE, uses a common begin.time to set origin (0) for Time variable defaults to FALSE for legacy reasons but should be set to TRUE for models that share formula like p and c with the Time model

sub.stratum

the number of strata to subtract for parameters that use mlogit across strata like pi and Omega for RDMSOpenMisClass

limits

For RDMSOccRepro values that set row and col (if any) start on states

events

vector of events if needed for parameter

use.events

if TRUE, adds events to design data

mscale

scalar for multi-scale occupancy model (number of mixtures)

subtract.events

for each stratum either the stratum or event to compute by subtraction for mlogit parameter

Details

This function is called by make.design.data to create all of the default design data for a particular type of model and by add.design.data to add binned design data fields for a particular type of parameter. The design data created by this function include group, age, time and cohort as factors variables and continuous (non-factor) versions of all but group. In addition, if groups have been defined for the data, then a data column is added for each factor variable used to define the groups. Also for specific closed capture heterogeneity models (model="HetClosed", "FullHet", "HetHug", "FullHetHug") the data column mixture is added to the design data. The arguments for this function are defined for each model by the function setup.model.

Value

design.data: a data frame containing all of the design data fields for a particular type of parameter

group

group factor level

age

age factor level

time

time factor level

cohort

cohort factor level

Age

age as a continuous variable

Time

time as a continuous variable

Cohort

cohort as a continuous variable

mixture

mixture factor level

other fields

any factor variables used to define groups

Author(s)

Jeff Laake

See Also

make.design.data, add.design.data


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