Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.coef

Plots the posterior distributions of coefficients derived from Bayesian model averaging


Description

Displays plots of the posterior distributions of the coefficients generated by Bayesian model averaging over linear regression.

Usage

## S3 method for class 'coef.bas'
plot(x, e = 1e-04, subset = 1:x$n.vars, ask = TRUE, ...)

Arguments

x

object of class coef.bas

e

optional numeric value specifying the range over which the distributions are to be graphed.

subset

optional numerical vector specifying which variables to graph (including the intercept)

ask

Prompt for next plot

...

other parameters to be passed to plot and lines

Details

Produces plots of the posterior distributions of the coefficients under model averaging. The posterior probability that the coefficient is zero is represented by a solid line at zero, with height equal to the probability. The nonzero part of the distribution is scaled so that the maximum height is equal to the probability that the coefficient is nonzero.

The parameter e specifies the range over which the distributions are to be graphed by specifying the tail probabilities that dictate the range to plot over.

Note

For mixtures of g-priors, uncertainty in g is not incorporated at this time, thus results are approximate

Author(s)

based on function plot.bic by Ian Painter in package BMA; adapted for 'bas' class by Merlise Clyde clyde@stat.duke.edu

References

Hoeting, J.A., Raftery, A.E. and Madigan, D. (1996). A method for simultaneous variable selection and outlier identification in linear regression. Computational Statistics and Data Analysis, 22, 251-270.

See Also

Other bas plots: image.bas(), plot.bas()

Examples

## Not run: library(MASS)
data(UScrime)
UScrime[,-2] <- log(UScrime[,-2])
crime_bic <- bas.lm(y ~ ., data=UScrime, n.models=2^15, prior="BIC")
plot(coefficients(crime_bic), ask=TRUE)

## End(Not run)

BAS

Bayesian Variable Selection and Model Averaging using Bayesian Adaptive Sampling

v1.5.5
GPL (>= 3)
Authors
Merlise Clyde [aut, cre, cph] (ORCID=0000-0002-3595-1872), Michael Littman [ctb], Quanli Wang [ctb], Joyee Ghosh [ctb], Yingbo Li [ctb], Don van de Bergh [ctb]
Initial release
2020-1-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.