On 10/16/13 23:56, Benjamin Ward (ENV) wrote:
Hi,

Thanks again for your answers, just so as I can get clear what is happening, 
with the uniroot method, I'm defining a function in which the binomial 
probability function pbinom is present but in addition p0 is subtracted from 
the result - in this case p0 is the large P I want to plug in so 0.05, 0.50 and 
0.95, or even just 0.05 and 0.95? Then uniroot finds the root of this function 
and doing so find me the small p I need?

I believe that you have a correct understanding.  To beat it to death:

    * you want/need to solve an equation of the form

        f(p) = p0

       for p.

    * the uniroot() function solves equations of the form

        g(p) = 0

       for p

* therefore define g(p) = f(p) - p0 and apply uniroot() to the function g(.).

HTH.

    cheers,

    Rolf Turner

______________________________________________
R-help@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.

Reply via email to