Skip to contents

Takes outputs from fit_rema, and returns a named list of tidied data.frames that include parameter estimates and standard errors, and derived variables from the model. For more information on "tidy" data, please see Wickham 2014. Some code modified from wham::par_tables_fun.

Usage

tidy_rema(rema_model, save = FALSE, path = NULL, alpha_ci = 0.05)

Arguments

rema_model

list out output from fit_rema, which includes model results but also inputs

save

(optional) logical (T/F) save output data.frames as csvs in path. Default = FALSE. NOT YET IMPLEMENTED.

path

(optional) directory path to location where csvs are to be saved if save = TRUE. NOT YET IMPLEMENTED.

alpha_ci

(optional) the significance level for generating confidence intervals. Default = 0.05

Value

a list with the following items:

$parameter_estimates

A data.frame of fixed effects parameters in REMA (e.g. log_PE and log_q) with standard errors and confidence intervals that have been transformed from log space to natural space for ease of interpretation.

$biomass_by_strata

A tidy, long format data.frame of model predicted and observed biomass by biomass survey strata.

$cpue_by_strata

A tidy, long format data.frame of model predicted and observed CPUE by CPUE survey strata. If REMA is not run in multi-survey mode, or if CPUE data are not provided, an explanatory character string with instructions for fitting to CPUE data is returned.

$biomass_by_cpue_strata

A tidy, long format data.frame of model predicted biomass by CPUE survey strata. Note that observed/summed biomass observations are not returned in case there are missing values in one stratum but not another within a given year. This output is reserved for instances when the number of biomass strata exceeds that of CPUE survey strata, but the user wants to visualize predicted biomass at the same resolution as the CPUE predictions. In other scenarios, a character string is returned explaining the special use case for this object.

$total_predicted_biomass

A tidy, long format data.frame of total model predicted biomass summed across all biomass survey strata. If only one stratum is used (i.e. the univariate RE), the predicted values will be the same as output$biomass_by_strata.

$total_predicted_cpue

A tidy, long format data.frame of total model predicted CPUE summed across all CPUE survey strata. If only one stratum is used (i.e. the univariate RE), the predicted values will be the same as output$cpue_by_strata. If The CPUE survey index provided was defined as not summable in prepare_rema_input(), an character string will be returned explaining how to change this using the 'sum_cpue_index' in ?prepare_rema_input if appropriate.

See also

Examples

if (FALSE) { # \dontrun{
# placeholder for example
} # }