Skip to content

How to get p-values

3 messages · Mathias Ditzen, Peter Dalgaard, John Fox

#
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
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Mathias Ditzen <mditzen at zedat.fu-berlin.de> writes:
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).
#
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:
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._