R language Access Menu

Title Text Both  

Bayesian regression

Can be performed using bayesglm function of arm package:

Code:

> bwdf = mybwdf(F)
> library(arm)
> bayesglm(bwt~., bwdf, family=gaussian)
bayesglm(formula = bwt ~ ., family = gaussian, data = bwdf)
            coef.est coef.se
(Intercept) 2926.21   312.78
age           -3.52     9.62
lwt            4.35     1.74
race2       -486.55   149.71
race3       -353.95   114.60
smoke1      -351.20   106.36
ptl          -48.79   101.88
ht1         -589.32   201.70
ui1         -514.47   138.67
ftv          -13.94    46.46
---
n = 189, k = 10
residual deviance = 75702596.9, null deviance = 99969655.8 (difference = 24267058.9)
overdispersion parameter = 422877.8
residual sd is sqrt(overdispersion) = 650.29


References:
Andrew Gelman and Yu-Sung Su (2015). arm: Data Analysis Using Regression and Multilevel/Hierarchical Models. R package version 1.8-6. http://CRAN.R-project.org/package=arm
 


    Comments & Feedback