R language Access Menu

Title Text Both  

MCMCregress of MCMCpack (Markov Chain Monte Carlo)

This is another way of performing bayesian regression: 

Code:

> library(MCMCpack)
> fit = MCMCregress(bwt~., bwdf)
> summary(fit)

Iterations = 1001:11000
Thinning interval = 1 
Number of chains = 1 
Sample size per chain = 10000 

1. Empirical mean and standard deviation for each variable,
   plus standard error of the mean:

                  Mean        SD  Naive SE Time-series SE
(Intercept)   2927.487   314.280   3.14280        3.14280
age             -3.612     9.724   0.09724        0.09724
lwt              4.360     1.742   0.01742        0.01802
race2         -487.125   152.303   1.52303        1.52303
race3         -354.302   115.195   1.15195        1.15195
smoke1        -351.762   106.969   1.06969        1.06969
ptl            -47.781   103.253   1.03253        1.03253
ht1           -594.622   202.717   2.02717        2.02717
ui1           -516.872   139.570   1.39570        1.37458
ftv            -14.288    46.357   0.46357        0.46357
sigma2      428228.023 45926.387 459.26387      474.20391

2. Quantiles for each variable:

                   2.5%        25%        50%        75%     97.5%
(Intercept)   2319.9976   2714.836   2928.848   3136.161   3547.30
age            -22.6783    -10.163     -3.624      2.915     15.33
lwt              0.9101      3.194      4.347      5.533      7.74
race2         -781.7799   -588.469   -487.134   -386.108   -182.57
race3         -580.2590   -432.502   -353.771   -277.044   -127.53
smoke1        -561.7940   -423.907   -351.152   -278.989   -146.31
ptl           -247.3588   -119.592    -48.530     22.153    155.76
ht1           -987.5362   -732.388   -595.722   -458.163   -186.32
ui1           -796.0243   -612.131   -517.195   -422.456   -249.28
ftv           -101.9990    -45.971    -15.157     16.266     79.58
sigma2      346080.0087 396467.530 424989.076 457354.527 525448.25


References:
Andrew D. Martin, Kevin M. Quinn, Jong Hee Park (2011). MCMCpack: Markov Chain Monte Carlo in R. Journal of Statistical Software. 42(9): 1-21. URL http://www.jstatsoft.org/v42/i09/.
 


    Comments & Feedback