bayes.lm.ref {spBayes} | R Documentation |
Given an lm
object, the bayes.lm.ref
function fits a
simple Bayesian linear model with reference (non-informative) priors.
bayes.lm.ref(lm.obj, n.samples, ...)
lm.obj |
an object returned by lm . |
n.samples |
the number of posterior samples to collect. |
... |
currently no additional arguments. |
See page 355 in Gelman et al. (2004).
A CODA mcmc
matrix object with columns corresponding to each
parameter and posterior samples held in the rows.
Sudipto Banerjee sudiptob@biostat.umn.edu,
Andrew O. Finley finleya@msu.edu
Gelman, A., Carlin, J.B., Stern, H.S., and Rubin, D.B. (2004). Bayesian Data Analysis. 2nd ed. Boca Raton, FL: Chapman and Hall/CRC Press.
data(FORMGMT.dat) lm.obj <- lm(Y ~ X1+X2+X3+X4+X5+X6, data = FORMGMT.dat) summary(lm.obj) ##Now with bayes.lm.ref n.samples <- 500 out.bayes.lm.ref <- bayes.lm.ref(lm.obj, n.samples) summary(out.bayes.lm.ref)