Calculate stratified means, variances and confidence intervals across groups
strat_means(
data = NULL,
metric = NULL,
strat_groups = NULL,
survey_groups = NULL,
confidence = 95
)
Expects data.table with all grouping variables in stacked format (must include strat_area and tow_area for scaling values)
Variable in specificed data.table. e.g. "number", "mass"
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")
Grouping variables for large-scale summary calculations. e.g. ("year","species")
Percent for confidence limits
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