[R] errors in help("TDist")?

Thomas Lumley tlumley at u.washington.edu
Thu Nov 29 17:53:50 CET 2001


On Thu, 29 Nov 2001, Emmanuel Paradis wrote:

> Dear all,
>
> The help page on the t distribution says:
>
>      The most used applications are power calculations for t-tests:
>      Let T= (mX - m0) / (S/sqrt(n)) where mX is the `mean' and S the
>      sample standard deviation (`sd') of X_1,X_2,...,X_n which are
>      i.i.d. N(mu,sigma^2). Then T is distributed as non-centrally t
>      with `df'= n-1 degrees of freedom and non-centrality parameter
>      `ncp'= mu - m0.
>
> 1) It seems that power.t.test() uses ncp = sqrt(n) * (mu - m0)/sigma. Is
> the above incorrect, or am I missing something?

Yes, the above is incorrect. The code is correct.

> 2) I thought the paramaters of the normal distribution were mean and
> standard-deviation: should one read "N(mu, sigma)" above?

The parameters of the functions {p,q,r,d}norm are mean and standard
deviation but the standard statistical notation is N(mu,sigma^2).

> 3) I understand that the non-central t is obtained from the t by "sliding"
> its distribution by 'ncp': the density of the former could thus be obtained
> with dt(x, nu) + ncp. If so, is it worth adding this to the help?

I think you mean dt(x-ncp,nu), but even that isn't correct. Life would be
much simpler if it were.

The problem is that the statistic is distributed as the sum of

   (sample mean-mX)/(S/sqrt(n)) + (mX-m0)/(S/sqrt(n))

The first part has the shifted t-distribution, but the second part is also
a random variable and for smallish sample sizes makes a big difference.


	-thomas

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