build_spec_coveff {BayesERtools}R Documentation

Build specifications for covariate effect simulation/visualization

Description

Build specifications for covariate effect simulation/visualization

Usage

build_spec_coveff(
  ermod,
  data = NULL,
  qi_width_cov = 0.9,
  n_sigfig = 3,
  use_seps = TRUE,
  drop_trailing_dec_mark = TRUE
)

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.

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).

n_sigfig

Number of significant figures to form value_label of continuous variables. See gt::vec_fmt_number() for details.

use_seps

Whether to use separators for thousands in printing numbers. See gt::vec_fmt_number() for details.

drop_trailing_dec_mark

Whether to drop the trailing decimal mark (".") in value_label of continuous variables. See gt::vec_fmt_number() for details.

Value

spec_coveff (return object) is a data frame for the specification of the covariate effects to be visualized. This is internally generated by build_spec_coveff() if you run sim_coveff() or plot_coveff() directly. Alternatively, you can develop your own or modify the one generated by build_spec_coveff() and supply it to sim_coveff() or plot_coveff(). The data frame should have the following columns (but it's probably easier to try build_spec_coveff() and see the structure):

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 = c("BHBA1C_5", "RACE"),
)

spec_coveff <- build_spec_coveff(ermod_bin)
plot_coveff(ermod_bin, spec_coveff = spec_coveff)



[Package BayesERtools version 0.2.3 Index]