Subject: | Degrees of freedom for t-test need not be an integer |
For those nasty scenarios where you can't assume equal variance for the
t-test, you end up using approximations for degrees of freedom based on
the Welch-Satterthwaite equation. These approximations are based on the
variance and degrees of freedom of the two sets being compared -
essentially:
$nu = ((($s1*$s1)/$n1) + (($s2*$s2)/ $n2)) * ((($s1*$s1)/$n1) +
(($s2*$s2)/ $n2)) /
(
(($s1*$s1*$s1*$s1)/($n1*$n1*($n1 - 1))) +
(($s2*$s2*$s2*$s2)/($n2*$n2*($n2 - 1)))
)
The validity checks in the tprob and tdistr functions for integer n
should be removed.