Learn R Programming

asbio (version 1.0-5)

bayes.lm: Bayesian linear models with uniform priors

Description

Gelman et al. (2002) described general methods for Bayeisan implementation of simple linear models (e.g. simple and multiple regression and fixed effect one way ANOVA) with standard non-informative priors uniform on $\alpha, \sigma^2$. The function is not yet suited for multifactor or multivariance (random effect) ANOVAs.

Usage

bayes.lm(Y, X, model = "anova", length = 1000, cred = 0.95)

Arguments

Y
An n x 1 column vector (a matrix with one column) containing the response variable.
X
The n x p design matrix
model
One of "anova" or "reg". Parameter output labels are changed depending on choice.
length
Number of draws for posterior.
cred
Region for credble interval.

Value

  • Provides the median and central credible intervals for model parameters.

References

Gelman, A., Carlin, J. B., Stern, H. S., and D. B. Rubin (2003) Bayesian Data Analysis, 2nd edition. Chapman and Hall/CRC.

See Also

mcmc.norm.hier

Examples

Run this code
data(Fbird)
X <- with(Fbird, cbind(rep(1, 18), vol))
Y <- Fbird$freq
bayes.lm(Y,X)

Run the code above in your browser using DataLab