[R] rate instead of scale in ?ks.test

From: Ramón Casero Cañas <8-T_at_gmx.net>
Date: Mon 03 Oct 2005 - 05:03:37 EST

I am not sure whether I'm doing something wrong or there is a bug in the documentation of ks.test. Following the posting guide, as I'm not sure, I haven't found this in the bug tracker, and the R FAQ says that stats is an Add-on package of R, I think this is the place to send it.

?ks.test provides the example

<QUOTE>
# Does x come from a shifted gamma distribution with shape 3 and scale 2? ks.test(x+2, "pgamma", 3, 2) # two-sided </QUOTE>

Maybe it should say ``with shape 3 and rate 2''?

If I do

> x <- rgamma(1e6, shape = 3, scale = 2)
> ks.test( x, 'pgamma', 3, 2 )

        One-sample Kolmogorov-Smirnov test

data: x
D = 0.7513, p-value < 2.2e-16
alternative hypothesis: two.sided

whereas with

> y <- rgamma(1e6, shape = 3, rate = 2)
 ks.test( y, 'pgamma', 3, 2 )

        One-sample Kolmogorov-Smirnov test

data: y
D = 5e-04, p-value = 0.9469
alternative hypothesis: two.sided

If forcing the parameter meaning:

> ks.test( x, 'pgamma', shape = 3, scale = 2 )

        One-sample Kolmogorov-Smirnov test

data: x
D = 9e-04, p-value = 0.3645
alternative hypothesis: two.sided

> version

platform i386-pc-linux-gnu

arch     i386
os       linux-gnu

system i386, linux-gnu
status
major 2
minor 1.1
year 2005
month 06
day 20
language R

> packageDescription( "stats" )

Package: stats
Version: 2.1.1
Priority: base
Title: The R Stats Package
Author: R Development Core Team and contributors worldwide Maintainer: R Core Team <R-core@r-project.org> Description: R statistical functions
License: GPL Version 2 or later.
Built: R 2.1.1; i386-pc-linux-gnu; 2005-06-29 23:30:55; unix

Cheers,

-- 
Ramón Casero Cañas

web:    http://www.robots.ox.ac.uk/~rcasero/

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon Oct 03 05:09:00 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:34 EST