postsim {rv} | R Documentation |
Generate posterior simulations for a given fitted linear or general linear model, assuming the standard "noninformative" priors on the unknowns.
postsim(fit) ## S3 method for class 'lm': postsim(fit) ## S3 method for class 'glm': postsim(fit)
fit |
an lm or glm object |
A (named) random vector for each fitted coefficient.
Jouni Kerman jouni@kerman.com
Kerman, J. and Gelman, A. (2007). Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Statistics and Computing 17:3, 235-244.
See also vignette("rv")
.
## Not run: x <- 1:20 y <- rnorm(length(x), mean=x, sd=10) print(summary(fit <- lm(y ~ x))) bayes.estimates <- postsim(fit) ## End(Not run)