prepStrata: This function prepares data to run multiple strata

Description Usage Arguments

View source: R/prepStrata.R

Description

The model is actually run by a separate function in order to allow a user to edit the priors and initial values before running.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
prepStrata(
  trapData,
  tags,
  GSIcol,
  PBTcol,
  strataCol,
  variableCols = c(),
  variableColsOth = c(),
  adFinCol,
  AI = TRUE,
  GSIgroups = NA,
  variableValues = NA,
  variableValuesOth = NA,
  symPrior = 0.5,
  verbose = TRUE
)

Arguments

trapData

dataframe with data for fish sampled from one strata - trap data for dam escapement

tags

dataframe with tag rates for all groups. This should NOT include the Unassigned group.

GSIcol

name of column containing GSI assignments. If you have no GSI information, create a column with the same value for all samples.

PBTcol

name of column containing PBT assignments

strataCol

name of column indicating the strata the observation belongs to

variableCols

vector of column names of columns containing the variables to estimate composition and to inform the group selection for PBT untagged fish

variableColsOth

vector of column names of columns containing the variables to estimate composition but NOT inform the group selection for PBT untagged fish

adFinCol

name of column containing adipose fin status - TRUE (or AI) being intact FALSE (or AD) being clipped, NA missing

AI

TRUE to analyze ad-intact fish, FALSE to analyze ad-clipped fish

GSIgroups

These are the values for all the GSI groups that you expect to be present in the population. If NA, then the values are taken to be all the unique values in the GSI column in the dataset within each strata (ie unobserved groups are assumed to be 0).

variableValues

a list, in the order of variableCols with entries having the values expected for each variable. This is helpful to make sure the same variable values are estiamted in each strata even if one value is not observed in all strata. If a value other than a list is given (for example, NA), it uses the values present in the dataset within each strata (ie unobserved groups are assumed to be 0).

variableValuesOth

Same as variableValues, but for variableColsOth

symPrior

All the priors are Dirichlet distributions. The default is to use this value for all the alphas of all the priors. You can, and are encouraged to, manually adjust the priors as you see fit prior to running the MCMC chain.

verbose

TRUE to print some messages, FALSE to not


delomast/fishCompTools documentation built on Jan. 11, 2021, 1:51 a.m.