param_estimates_compare: Compare parameter estimates

param_estimates_compareR Documentation

Compare parameter estimates

Description

Summarizes each parameter estimate, showing you the quantiles passed to probs, and optionally the estimates of .orig_mod.

Usage

param_estimates_compare(
  .boot_sum,
  .orig_mod = NULL,
  .compare_cols = starts_with(c("THETA", "SIGMA", "OMEGA")),
  probs = c(0.5, 0.025, 0.975),
  na.rm = FALSE
)

## S3 method for class 'bbi_nmboot_summary'
param_estimates_compare(
  .boot_sum,
  .orig_mod = NULL,
  .compare_cols = NULL,
  probs = c(0.5, 0.025, 0.975),
  na.rm = FALSE
)

## Default S3 method:
param_estimates_compare(
  .boot_sum,
  .orig_mod = NULL,
  .compare_cols = starts_with(c("THETA", "SIGMA", "OMEGA")),
  probs = c(0.5, 0.025, 0.975),
  na.rm = FALSE
)

Arguments

.boot_sum

Either a bbi_nmboot_summary object, or a tibble with columns for each parameter and rows for each model (like what's returned from param_estimates_batch()).

.orig_mod

bbi_model object to compare .boot_sum against. This will be automatically set if passing in a bbi_nmboot_summary object.

.compare_cols

An expression that can be passed to dplyr::select() to select which columns in .boot_sum will be pivoted and summarized. See ?tidyselect::language for more details and options. Only used if .boot_sum is a tibble.

probs

Numeric vector with values between 0 and 1 to be passed through to stats::quantile(). Represents the quantiles to calculate for parameter estimates in .boot_sum.

na.rm

Logical scalar, passed through to stats::quantile().

Value

A tibble containing quantiles for each parameter estimate, optionally compared to the estimates from .orig_mod.

See Also

summarize_bootstrap_run()

Examples

## Not run: 

# Via a bootstrap run
boot_run <- read_model(file.path(MODEL_DIR, "1-boot"))
boot_sum <- summarize_bootstrap_run(boot_run)
param_estimates_compare(boot_sum)

# Via a custom table
orig_mod <- read_model(file.path(MODEL_DIR, "1"))
param_df <- param_estimates_batch(MODEL_DIR)
param_estimates_compare(param_df, .orig_mod = orig_mod)

## End(Not run)


metrumresearchgroup/bbr documentation built on March 29, 2025, 1:08 p.m.