Skip to contents

Create summary table of demographic rates from survival and recruitment surveys

Usage

bbouMakeSummaryTable(
  surv_data,
  recruit_data,
  N0 = NA,
  disturbance = NULL,
  priors = NULL,
  shiny_progress = FALSE,
  return_mcmc = FALSE,
  i18n = NULL,
  niters = formals(bboutools::bb_fit_survival)$niters,
  nthin = formals(bboutools::bb_fit_survival)$nthin,
  ...
)

Arguments

surv_data

dataframe. Survival data in bboudata format

recruit_data

dataframe. Recruitment data in bboudata format

N0

dataframe. Optional. Initial population estimates, required columns are PopulationName and N0

disturbance

dataframe. Optional. If provided, fit a Beta model that includes disturbance covariates.

priors

list. Optional. If disturbance is NA, this should be list(priors_survival=c(...),priors_recruitment=c(...)); see bboutools::bb_priors_survival and bboutools::bb_priors_recruitment for details. If disturbance is not NA, see getPriors for details.

shiny_progress

logical. Should shiny progress bar be updated. Only set to TRUE if using in an app.

return_mcmc

boolean. If TRUE return fitted survival and recruitment models. Default FALSE.

niters

integer. The number of iterations per chain after thinning and burn-in.

nthin

integer. The number of the thinning rate.

...

Other parameters passed on to bboutools::bb_fit_survival and bboutools::bb_fit_recruitment.

Value

If return_mcmc is TRUE then a list with results and fitted models, if FALSE just the results table is returned.

Examples

s_data <- rbind(bboudata::bbousurv_a, bboudata::bbousurv_b)
r_data <- rbind(bboudata::bbourecruit_a, bboudata::bbourecruit_b)
bbouMakeSummaryTable(s_data, r_data, N0 = 500)
#> Registered S3 method overwritten by 'mcmcr':
#>   method         from 
#>   as.mcmc.nlists nlist
#>   pop_name     R_bar       R_sd R_iv_mean R_iv_shape R_bar_lower R_bar_upper
#> 1        A 0.1894674 0.08221914 0.3181985   27.36116   0.1641481   0.2145582
#> 2        B 0.2035216 0.10678741 0.3181985   27.36116   0.1711268   0.2375047
#>       S_bar      S_sd S_iv_mean S_iv_shape S_bar_lower S_bar_upper  N0
#> 1 0.8819087 0.2362733 0.4909915   9.805237   0.8220255   0.9238527 500
#> 2 0.9051799 0.2828061 0.4909915   9.805237   0.8476911   0.9446732 500
#>   nCollarYears nSurvYears nCowsAllYears nRecruitYears
#> 1          900         31          2353            27
#> 2          519         18          2001            15