[R] (no subject)

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed Mar 11 13:32:58 CET 2009



Shuying Yang wrote:
> Dear Members,
> 
>  
> 
> I have a question about using R2WinBUGS to obtain the WinBUGS results. 
> 
>  
> 
> By default, when R2WinBUGS returns summary stats, I got mean, sd, 2.5%, 25%, median, 75% and 97.5%.  Could anyone tell me how to modify the code to obtain 5% and 95% summary results?


Hi,

please read the posting guide and use a sensible subject line (I almost 
missed your posting).

The used quantiles in the printed output are hardcoded, but you can 
calculate arbitrary quantiles from the data.

Ad an example, please consider the schools example from ?bugs, running 
the example results in an object called "schools.sim". Now you can 
calculate arbitrary quantiles as e.g. in:

apply(schools.sim$sims.matrix, 2, quantile, c(0.05, 0.95))

Uwe Ligges

>  
> 
> Many thanks
> 
>  
> 
> Alice
> 
>  
> 
>  
> 
> _________________________________________________________________
> [[elided Hotmail spam]]
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list