[R] quantile function for noncentral f-distribution

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jan 9 10:00:00 CET 2001


On Tue, 9 Jan 2001, Juergen Hedderich wrote:

> 
> hello R-friends,
> I'm looking for a quantile function for the noncentral
> f-distribution in the area of equivalence hypotheses testing.
> Can somebody help me?

Since pf has a non-centrality parameter, you can easily invert it.

myqf <- function(p, df1, df2, ncp)
{
uniroot(function(x) pf(x, df1, df2, ncp) - p, , 0, 100)$root
}

adjust 100 to suit (one can surely come up with an useful computed upper
bound if ncp might be large), and add a tol arg to uniroot if you care.


> 
> Many thanks 
> 
> -----------------------------------------------------------------
> Dipl. Inform. J. Hedderich              
> Institut für Medizinische Informatik       Phone : 0431 /
> 5973182               
> und Statistik im Klinikum an der CAU       Fax   : 0431 / 5973193
>                
> Brunswiker Str.
> 10                                                          
> 24105 Kiel                  
> E-mail:hedderich at medinfo.uni-kiel.de                                            
> -----------------------------------------------------------------
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list