[R] Noncentral t & F distributions
Alan Arnholt
arnholt at cs.appstate.edu
Sun Dec 10 21:45:07 CET 2006
Dear List:
The square of the noncentral t-statistic with noncentrality parameter
\delta is a noncentral F with noncentrality parameter \lambda=\delta^2.
So, t^2_{\nu,\delta} = F_{1,\nu,\lambda=\delta^2}. Consequently, it
should follow that t^2_{1-\alpha/2,\nu,\delta} =
f_{1-alpha,1,\vu,\lambda=\delta^2}. However, this is not what is
happening with the following code. The central distributions agree as
they should but the noncentral distributions do not. Am I missing
something or is there a bug in the code?
> alpha <- 0.05
> nu <- 10
> NCP <- c(0,1,2,3)
> TV <- (qt(1-alpha/2,nu,NCP))^2
> FV <- qf(1-alpha,1,nu,NCP^2)
> rbind(TV,FV)
[,1] [,2] [,3] [,4]
TV 4.964603 12.535179 24.58013 41.71937
FV 4.964603 9.285829 18.98771 32.97855
> TV <- (qt(1-alpha/2,nu,NCP))^2
> FV <- qf(1-alpha/2,1,nu,NCP^2)
> rbind(TV,FV)
[,1] [,2] [,3] [,4]
TV 4.964603 12.53518 24.58013 41.71937
FV 6.936728 12.56450 24.58023 41.71937
Thanks,
Alan-
> version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor 4.0
year 2006
month 10
day 03
svn rev 39566
language R
version.string R version 2.4.0 (2006-10-03)
Alan T. Arnholt
Associate Professor
Dept. of Mathematical Sciences
Appalachian State University
TEL: 828 262 2863
FAX: 828 265 8617
More information about the R-help
mailing list