[Rd] Noncentral problems in pf() (PR#8251)

kkiii@indiana.edu kkiii at indiana.edu
Tue Oct 25 15:54:57 CEST 2005


Full_Name: Ken Kelley
Version: 2.2
OS: Windows XP
Submission from: (NULL) (156.56.3.241)


It seems that the pf() function when used with noncentral parameters can 
behave badly at times. I've included some examples below, but what is 
happening is that with some combinations of df and ncp parameters, 
regardless of how large the quantile gets, the same probability value is 
returned. Upon first glance noncentral values greater than 200 may seem 
large, but they are in some contexts not large at all. The problems with 
pf() can thus have serious implications (for example, in the context of 
sample size planning).

I noticed that in in 1999 and 2000 issues with large degrees of freedom 
came about (PR#138), but I couldn't find the present issue reported 
anywhere.

# <Begin example code>
X <- seq(10, 600, 10)

# Gets stuck at .99135
############################
round(pf(X, 10, 1000, 225), 5)
round(pf(X, 10, 200, 225), 5)

round(pf(X, 5, 1000, 225), 5)
round(pf(X, 5, 200, 225), 5)

round(pf(X, 1, 1000, 225), 5)
round(pf(X, 1, 200, 225), 5)

# Gets stuck at .97035
############################
round(pf(X, 10, 1000, 250), 5)
round(pf(X, 10, 200, 250), 5)

round(pf(X, 5, 1000, 250), 5)
round(pf(X, 5, 200, 250), 5)

round(pf(X, 1, 1000, 250), 5)
round(pf(X, 1, 200, 250), 5)

# Gets stuck at .93539
############################
round(pf(X, 10, 1000, 275), 5)
round(pf(X, 10, 200, 275), 5)

round(pf(X, 5, 1000, 275), 5)
round(pf(X, 5, 200, 275), 5)

round(pf(X, 1, 1000, 275), 5)
round(pf(X, 1, 200, 275), 5)
# <end example code>



More information about the R-devel mailing list