Calculate stratified means, variances and confidence intervals across groups

strat_means(
  data = NULL,
  metric = NULL,
  strat_groups = NULL,
  survey_groups = NULL,
  confidence = 95
)

Arguments

data

Expects data.table with all grouping variables in stacked format (must include strat_area and tow_area for scaling values)

metric

Variable in specified data.table. e.g. "number", "mass"

strat_groups

Grouping variables for calculations of the fine-scale strat-level means (strat and strat_area are required). e.g. c("year", "species", "shiptrip", "NAFOdiv", "strat", "strat_area","age")

survey_groups

Grouping variables for large-scale summary calculations. e.g. ("year","species")

confidence

Percent for confidence limits

Value

Returns a data.table including stratified estimates of abundance.

Details

Function was mainly created for use in the run_strat function. It first calculates strat-level statistics and then the larger-scale statistics like total abundance