Last data update: 2014.03.03

R: Coefficients of a Bayesian Model Average object
coef.bmaR 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 BMA

Usage

## S3 method for class 'bma'
coef(object, ...)
## S3 method for class 'coef.bma'
print(x, n.models=5,digits = max(3, getOption("digits") - 3),...)

Arguments

object

object of class 'bma' created by BAS

x

object of class 'coef.bma' to print

n.models

Number of top models to report in the printed summary

digits

number of significant digits to print

...

other optional arguments

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.bma 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.bma to view distributions.

Author(s)

Merlise Clyde clyde@stat.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.
http://dx.doi.org/10.1198/016214507000001337

See Also

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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BAS)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BAS/coefficients.bma.Rd_%03d_medium.png", width=480, height=480)
> ### Name: coef.bma
> ### Title: Coefficients of a Bayesian Model Average object
> ### Aliases: coef.bma coef coefficients coefficients.bma print.coef.bma
> ### Keywords: regression
> 
> ### ** 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

 Marginal Posterior Summaries of Coefficients: 
           post mean  post SD   post p(B != 0)
Intercept  95.42308    0.67885   1.00000      
X1          1.40116    0.35351   0.97454      
X2          0.42326    0.38407   0.76017      
X3         -0.03997    0.33398   0.30660      
X4         -0.22077    0.36931   0.44354      
> plot(coef.hald.gprior)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>