Description Usage Arguments Details Value Author(s) See Also Examples
Performs a one or twosample KolmogorovSmirnov test. Includes the option to perform the twosample test using the formula notation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 
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 
This is exactly ks.test
except that a formula may be used for the twosample situation. The default version is simply a pass through to ks.test
. See ks.test
for more details.
See ks.test
.
Derek H. Ogle, derek@derekogle.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  ## 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)
## onesample (from ks.test) still works
ksTest(x+2, "pgamma", 3, 2)
ks.test(x+2, "pgamma", 3, 2)
## first twosample 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)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.