postsim {rv}R Documentation

Generate Posterior Simulations for lm or glm Objects

Description

Generate posterior simulations for a given fitted linear or general linear model, assuming the standard "noninformative" priors on the unknowns.

Usage

  postsim(fit)
  ## S3 method for class 'lm':
  postsim(fit)
  ## S3 method for class 'glm':
  postsim(fit)

Arguments

fit an lm or glm object

Value

A (named) random vector for each fitted coefficient.

Author(s)

Jouni Kerman kerman@stat.columbia.edu http://www.stat.columbia.edu/~kerman

References

Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.

Examples

  x <- 1:20
  y <- rnorm(length(x), mean=x, sd=10)
  print(summary(lm.fit <- lm(y ~ x)))
  random.estimates <- postsim(lm.fit)

[Package rv version 0.911 Index]