Displays plots of the posterior distributions of the coefficients generated by Bayesian model averaging over linear regression, generalized linear and survival analysis models.
# S3 method for bicreg
plot(x, e = 1e-04, mfrow = NULL,
include = 1:x$n.vars, include.intercept = TRUE, ...)# S3 method for bic.glm
plot(x, e = 1e-04, mfrow = NULL,
include = 1:length(x$namesx), ...)
# S3 method for bic.surv
plot(x, e = 1e-04, mfrow = NULL,
include = 1:length(x$namesx), ...)
object of type bicreg, bic.glm or bic.surv.
optional numeric value specifying the range over which the distributions are to be graphed.
optional vector specifying the layout for each set of graphs
optional numerical vector specifying which variables to graph (excluding intercept)
optional logical value, if true the posterior distribution of the intercept is incuded in the plots
other parameters to be passed to plot
and lines
Ian Painter ian.painter@gmail.com
Produces a plot of the posterior distribuion of the coefficients produced by 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.
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.
library(MASS)
data(UScrime)
x<- UScrime[,-16]
y<- log(UScrime[,16])
x[,-2]<- log(x[,-2])
plot( bicreg(x, y))
Run the code above in your browser using DataLab