bayesLMRef {spBayes} | R Documentation |
Given an lm
object, the bayesLMRef
function fits a
simple Bayesian linear model with reference (non-informative) priors.
bayesLMRef(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).
An object of class bayesLMRef
, which is a list with at
least the following tag:
p.samples |
a coda object of posterior samples for the defined
parameters. |
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 bayesLMRef n.samples <- 500 m.1 <- bayesLMRef(lm.obj, n.samples) summary(m.1$p.sample)