coef.bas {BAS} | R Documentation |
Coefficients of a Bayesian Model Average object
Description
Extract conditional posterior means and standard deviations, marginal posterior means and standard deviations, posterior probabilities, and marginal inclusions probabilities under Bayesian Model Averaging from an object of class 'bas'
Usage
## S3 method for class 'bas'
coef(object, n.models, estimator = "BMA", ...)
## S3 method for class 'coef.bas'
print(x, digits = max(3, getOption("digits") - 3), ...)
Arguments
object |
object of class 'bas' created by BAS |
n.models |
Number of top models to report in the printed summary, for coef the default is to use all models. To extract summaries for the Highest Probability Model, use n.models=1 or estimator="HPM". |
estimator |
return summaries for a selected model, rather than using BMA. Options are 'HPM' (highest posterior probability model) ,'MPM' (median probability model), and 'BMA' |
... |
other optional arguments |
x |
object of class 'coef.bas' to print |
digits |
number of significant digits to print |
Details
Calculates posterior means and (approximate) standard deviations of the regression coefficients under Bayesian Model averaging using g-priors and mixtures of g-priors. Print returns overall summaries. For fully Bayesian methods that place a prior on g, the posterior standard deviations do not take into account full uncertainty regarding g. Will be updated in future releases.
Value
coefficients
returns an object of class coef.bas with the
following:
conditionalmeans |
a matrix with conditional posterior means for each model |
conditionalsd |
standard deviations for each model |
postmean |
marginal posterior means of each regression coefficient using BMA |
postsd |
marginal posterior standard deviations using BMA |
postne0 |
vector of posterior inclusion probabilities, marginal probability that a coefficient is non-zero |
Note
With highly correlated variables, marginal summaries may not be
representative of the joint distribution. Use plot.coef.bas
to
view distributions. The value reported for the intercept is
under the centered parameterization. Under the Gaussian error
model it will be centered at the sample mean of Y.
Author(s)
Merlise Clyde clyde@duke.edu
References
Liang, F., Paulo, R., Molina, G., Clyde, M. and Berger, J.O.
(2005) Mixtures of g-priors for Bayesian Variable Selection. Journal of the
American Statistical Association. 103:410-423.
doi:10.1198/016214507000001337
See Also
Other bas methods:
BAS
,
bas.lm()
,
confint.coef.bas()
,
confint.pred.bas()
,
diagnostics()
,
fitted.bas()
,
force.heredity.bas()
,
image.bas()
,
plot.confint.bas()
,
predict.basglm()
,
predict.bas()
,
summary.bas()
,
update.bas()
,
variable.names.pred.bas()
Examples
data("Hald")
hald.gprior = bas.lm(Y~ ., data=Hald, n.models=2^4, alpha=13,
prior="ZS-null", initprobs="Uniform", update=10)
coef.hald.gprior = coefficients(hald.gprior)
coef.hald.gprior
plot(coef.hald.gprior)
confint(coef.hald.gprior)
#Estimation under Median Probability Model
coef.hald.gprior = coefficients(hald.gprior, estimator="MPM")
coef.hald.gprior
plot(coef.hald.gprior)
plot(confint(coef.hald.gprior))
coef.hald.gprior = coefficients(hald.gprior, estimator="HPM")
coef.hald.gprior
plot(coef.hald.gprior)
confint(coef.hald.gprior)
# To add estimation under Best Predictive Model