Learn R Programming

SimSurvey (version 0.1.4)

strat_error: Calculate error of stratified estimates

Description

Calculate error of stratified estimates

Usage

strat_error(sim)

Arguments

sim

Object from run_strat (includes simulated population and survey along with stratified analysis results)

Value

Adds details and summary stats of stratified estimate error to the sim list, ending with "_strat_error" or "_strat_error_stats". Error statistics includes mean absolute error ("MAE"), mean squared error ("MSE"), and root mean squared error ("RMSE")

Examples

Run this code
# NOT RUN {
sim <- sim_abundance(ages = 1:5, years = 1:5,
                     R = sim_R(log_mean = log(1e+7)),
                     growth = sim_vonB(length_group = 1)) %>%
           sim_distribution(grid = make_grid(res = c(10, 10)),
                            ays_covar = sim_ays_covar(sd = 1)) %>%
           sim_survey(n_sims = 1, q = sim_logistic(k = 2, x0 = 3)) %>%
           run_strat() %>%
           strat_error()

# }

Run the code above in your browser using DataLab