sim_coveff {BayesERtools}R Documentation

Perform simulation of covariate effects for ER model

Description

Perform simulation of covariate effects for ER model

Usage

sim_coveff(
  ermod,
  data = NULL,
  spec_coveff = NULL,
  output_type = "median_qi",
  qi_width = 0.9,
  qi_width_cov = 0.9
)

Arguments

ermod

an object of class ermod

data

an optional data frame to derive the covariate values for forest plots. If NULL (default), the data used to fit the model is used.

spec_coveff

you can supply spec_coveff to sim_coveff() or plot_coveff(), if you have already built it manually or with build_spec_coveff(). See build_spec_coveff() for detail.

output_type

Type of output. Currently only supports "median_qi" which returns the median and quantile interval.

qi_width

the width of the credible interval on the covariate effect. This translate to the width of the error bars in the forest plot.

qi_width_cov

the width of the quantile interval for continuous covariates in the forest plot. Default is 0.9 (i.e. visualize effect of covariate effect at their 5th and 95th percentile values).

Value

A data frame with class coveffsim containing the median and quantile interval of the covariate effects.

Examples



data(d_sim_binom_cov_hgly2)

ermod_bin <- dev_ermod_bin(
  data = d_sim_binom_cov_hgly2,
  var_resp = "AEFLAG",
  var_exposure = "AUCss_1000",
  var_cov = "BHBA1C_5",
)

sim_coveff(ermod_bin)



[Package BayesERtools version 0.2.3 Index]