[R] Re; Fitting a Beta distribution

Ben Bolker bbolker at gmail.com
Wed Mar 16 17:20:14 CET 2011


Jim Silverton <jim.silverton <at> gmail.com> writes:

> 
> I want to fit some p-values to a beta distribution. But the problem is some
> of the values have 0s and 1's. I am getting an error if I use the MASS
> function to do this. Is there anyway to get around this?

  The probability *density* of an exact 0 or 1 can be infinite
(as you can see by experimenting with dbeta() a bit) -- although
it may (?) require shape parameters <1, I don't remember.  The general
practice (see e.g. Smithson and Verkuilen "better lemon squeezer" paper),
as far as I know, is to take something like (x+e)/(1+2*e) where e is
a small fudge factor (that can be justified e.g. on Bayesian grounds ...)
Presumably if these are p-values then they aren't *exactly* 0/1, just
very close to it ... ?

  Would be interested to hear what others had to say.



More information about the R-help mailing list