strat_means: Calculate stratified means, variances and confidence...

View source: R/run_strat.R

strat_meansR Documentation

Calculate stratified means, variances and confidence intervals across groups

Description

Calculate stratified means, variances and confidence intervals across groups

Usage

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

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

Value

Returns a data.table including stratified estimates of abundance.


PaulRegular/surveyTestr documentation built on Sept. 21, 2023, 7:44 p.m.