Re: [R] Inverse cumulative probability

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue 14 Feb 2006 - 18:52:17 EST

On Tue, 14 Feb 2006, Jan Danielsson wrote:

> Hello all,
>
> (First of all, I'd like to thank all who replied to my previous
> question. I have never encountered such a helpful community before.
> Thanks for making a R so welcoming.)
>
> To calculate a quantile for normal distributions, one simply uses
> qnorm(1-a).

If a is small, it is better to use qnorm(a, lower.tail=FALSE).

> But if I would want to do the same for a t-test function,
> how would I go about doing that? Is there a simple way to do it? (Yes, I
> could look in a table, but it's the procedure I'm looking for, not the
> values :-)

qt(a, nu, lower.tail=FALSE), assuming by `t-test function' you mean Student's t distribution on nu degrees of freedom (which might be n-1 or n-2 for a t test).

For more on this see `An Introduction to R', specifically section 8.1 in the HTML version I just looked at.

-- 
Brian D. Ripley,                  ripley@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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Feb 14 18:56:43 2006

This archive was generated by hypermail 2.1.8 : Wed 15 Feb 2006 - 13:38:39 EST