bayes.lm.ref {spBayes}R Documentation

Simple Bayesian linear model with non-informative priors

Description

Given an lm object, the bayes.lm.ref function fits a simple Bayesian linear model with reference (non-informative) priors.

Usage

  bayes.lm.ref(lm.obj, n.samples, ...)

Arguments

lm.obj an object returned by lm.
n.samples the number of posterior samples to collect.
... currently no additional arguments.

Details

See page 355 in Gelman et al. (2004).

Value

A CODA mcmc matrix object with columns corresponding to each parameter and posterior samples held in the rows.

Author(s)

Sudipto Banerjee sudiptob@biostat.umn.edu,
Andrew O. Finley finleya@msu.edu

References

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.

Examples

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)


[Package spBayes version 0.0-7 Index]