View source: R/s3_methods_bma.R
| coef.badp_bma | R Documentation |
Coefficient extraction method for objects of class badp_bma.
## S3 method for class 'badp_bma'
coef(
object,
prior = "both",
conditional = FALSE,
se = FALSE,
robustSE = FALSE,
PIP = TRUE,
...
)
object |
An object of class |
prior |
Character string specifying which prior to use. Options are
|
conditional |
Logical. If |
se |
Logical. If |
robustSE |
Logical. Only meaningful when |
PIP |
Logical. If |
... |
Additional arguments (currently unused). |
This function extracts coefficient estimates from Bayesian Model Averaging
results. By default both priors are reported so the user can compare them
at a glance; set prior = "binomial" or prior = "beta" to
obtain the legacy single-prior return values (useful when feeding
coefficients into downstream code).
The shape of the return value depends on prior,
conditional, se, robustSE and PIP:
prior = "both": always a badp_bma_coef data frame.
Columns are grouped by prior; for each prior the columns
binom_PM / beta_PM (or binom_PMcon / beta_PMcon
when conditional = TRUE), standard error columns
binom_PSD / beta_PSD (or binom_PSDR / beta_PSDR
when robustSE = TRUE, or their con variants when
conditional = TRUE) when se = TRUE, and
binom_PIP / beta_PIP when PIP = TRUE.
prior = "binomial" or "beta": a named numeric
vector of estimates when se = FALSE and PIP = FALSE;
otherwise a data frame with columns PM (or PMcon
when conditional = TRUE), posterior standard deviation column
PSD / PSDR (or PSDcon / PSDRcon)
when se = TRUE, and PIP when PIP = TRUE.
bma, summary.badp_bma,
print.badp_bma_coef
data(full_model_space)
results <- bma(full_model_space)
# Posterior means under both priors with PIP
coef(results)
# With standard errors
coef(results, se = TRUE)
# With robust standard errors
coef(results, se = TRUE, robustSE = TRUE)
# Conditional posterior means and SEs
coef(results, conditional = TRUE, se = TRUE)
# Suppress PIP column
coef(results, PIP = FALSE)
# Single-prior numeric vector (legacy behaviour)
coef(results, prior = "binomial", PIP = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.