# [R] How to get p-values

John Fox jfox at mcmaster.ca
Mon Aug 5 15:22:41 CEST 2002

```Dear Mathias and Peter,

I'm pretty sure that Mathias is looking for the F and t quantile functions,
which, Mathias, by default return F and t values corresponding to
cumulative (i.e., left-tail) probabilities. So, for your example,

> qf(.95, 1, 2)
[1] 18.51282

gives you the F with 1 and 2 df that has an area of .05 to the right. See
help(qf) and help(qt) for details.

I hope that this helps,
John

At 12:36 PM 8/5/2002 +0200, Peter Dalgaard BSA wrote:
>Mathias Ditzen <mditzen at zedat.fu-berlin.de> writes:
>
> > Hello all there,
> > I want to reimplement (for my personal, still very limited
> understanding of
> > statistics) the linear regression. Now how do I get the correct values
> for F
> > and T distributions (something like F.05[1,2], where 1 and 2 are
> degrees of
> > freedom)? I tried dt and df, but the values I got were not correct.
> > Thank you very much in advance,
> > Mathias Ditzen
>
>Functions to give p values all start with p: pf and pt. Be careful to
>note that they give the lower tail of the respective distributions. To
>get an upper tail, subtract from 1 (or use lower.tail=FALSE). To get
>two-tailed tests add both tails together (which is often the same as
>multiplying by two).
>
>--
>    O__  ---- Peter Dalgaard             Blegdamsvej 3
>   c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
>  (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
>~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>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
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
email: jfox at mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```