plot.bicreg {BMA} | R Documentation |
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 class 'bicreg'
plot(x, e = 1e-04, mfrow = NULL,
include = 1:x$n.vars, include.intercept = TRUE, ...)
## S3 method for class 'bic.glm'
plot(x, e = 1e-04, mfrow = NULL,
include = 1:length(x$namesx), ...)
## S3 method for class 'bic.surv'
plot(x, e = 1e-04, mfrow = NULL,
include = 1:length(x$namesx), ...)
x |
object of type bicreg, bic.glm or bic.surv. |
e |
optional numeric value specifying the range over which the distributions are to be graphed. |
mfrow |
optional vector specifying the layout for each set of graphs |
include |
optional numerical vector specifying which variables to graph (excluding intercept) |
include.intercept |
optional logical value, if true the posterior distribution of the intercept is incuded in the plots |
... |
other parameters to be passed to |
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.
Ian Painter ian.painter@gmail.com
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))