1

I am conducting a Bayesian analysis in R thorough "R2Winbugs" package. In the R output, teh estimated parameters are rounded. My question is how can I control this?

Here is my command:

bugs(data, inits=inits, model.file = "C:/Users/Gunal/Desktop/dummy/dummyw.txt",
    parameters, digits=5,
    n.chains = 3, n.iter = 1000, codaPkg = FALSE,
    bugs.directory = "D:/PROGRAMLAR/WinBUGS14/")

and here is some part of my output

         mean  sd   2.5%    25%    50%    75%  97.5% Rhat n.eff
beta1    0.3 0.1    0.0    0.2    0.3    0.4    0.5  1.7     5

What I want is to see beta1 as 0.30000. I tried digits=5, but it did not work. Any one know what to do?

Any help would be greatly appreciated

Cheers

Günal

Tomas
  • 57,621
  • 49
  • 238
  • 373
Günal
  • 115
  • 1
  • 2
  • 4
  • Can you check this post http://stackoverflow.com/questions/3443687/formatting-decimal-places-in-r –  Dec 07 '12 at 13:44
  • Hi Mohan. Thanks for the link. I took a look at them, but could not see anything similar to this. They are mostly for inputs. My question is, however, about outputs. I am still waiting for an answer. – Günal Dec 07 '12 at 13:57

1 Answers1

1

Yeah, it's simple - use print(out, dig = 6) (or 7, 8, ...) to print the result:

out <- bugs(....)

print(out, dig = 6)
Tomas
  • 57,621
  • 49
  • 238
  • 373