Inverse cumulative probability

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Inverse cumulative probability

Jan Danielsson
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). 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 :-)

   I'm studying interference theory, and we got a few exercises to solve
in MiniTab. That was pretty simple, but now I want to solve them in R
instead (this is not a part of the course, so you won't be helping me
with my home work).

--
Kind Regards,
Jan Danielsson
Te audire non possum. Musa sapientum fixa est in aure.


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

signature.asc (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inverse cumulative probability

Prof Brian Ripley
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,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html