Kolmogorov-Smirnov Tests.
Performs a one- or two-sample Kolmogorov-Smirnov test. Includes the option to perform the two-sample test using the formula notation.
ksTest(x, ...) ## Default S3 method: ksTest( x, y, ..., alternative = c("two.sided", "less", "greater"), exact = NULL ) ## S3 method for class 'formula' ksTest( x, data = NULL, ..., alternative = c("two.sided", "less", "greater"), exact = NULL )
x |
A numeric vector of data values or a formula (see details). |
... |
Parameters of the distribution specified (as a character string) by |
y |
A numeric vector of data values, a character string naming a cumulative distribution function, or an actual cumulative distribution function. See |
alternative |
A string that indicates the alternative hypothesis. See |
exact |
|
data |
A data frame that contains the variables in the formula for |
See ks.test
.
Derek H. Ogle, derek@derekogle.com
## see ks.test for other examples x <- rnorm(50) y <- runif(30) df <- data.frame(dat=c(x,y), grp=factor(rep(c("x","y"),c(50,30))), stringsAsFactors=FALSE) ## one-sample (from ks.test) still works ksTest(x+2, "pgamma", 3, 2) ks.test(x+2, "pgamma", 3, 2) ## first two-sample example in ?ks.test ksTest(x,y) ks.test(x,y) ## same as above but using data.frame and formula ksTest(dat~grp,data=df)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.