R-beta:pt()

Thomas Lumley thomas at biostat.washington.edu
Thu Apr 24 18:07:18 CEST 1997


On Thu, 24 Apr 1997, Jim Lindsey wrote:

>   By the way, would it be possible to eliminate the line (floor) that
> rounds the degrees of freedom in pt.c? That way, pt can be used in
> likelihood functions for fitting the Student t distributions.

Yes please.  Non-integer degrees of freedom are very useful for
approximations as well. For example: Welch's unequal variance t-test,
Sattherthwaite approximations in ANOVA, and others.

If we can't get non-integer df we at least NEED a warning and preferably a
mention in the help file. It seems that qt() and rt() handle non-integer
df correctly (a relief, since I've been using them quite a bit) and that
the chisq and f distributions are ok too.

One simple solution is
	pt<-function(q,df) 1-0.5*(1-pf(q^2,1,df))

using the fact that a t(n) is the square root of an F(1,n).


Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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