Description Usage Arguments Details Value Note Author(s) References See Also Examples
Computes the test statistics for doing one-sample Cramer-von Mises goodness-of-fit tests and calculates asymptotic p-values.
1 |
x |
a numerical vector of data values. |
y |
an |
type |
the variant of the Cramer-von Mises test; |
Details here.
An object of class htest
.
Additional notes?
Taylor B. Arnold and John W. Emerson
Maintainer: Taylor B. Arnold <taylor.arnold@yale.edu>
V. Choulakian, R. A. Lockhart, and M. A. Stephens (1994). Cramer-von Mises statistics for discrete distributions. The Canadian Journal of Statistics, 22(1): 125-137.
H. Cramer (1928). On the composition of elementary errors. Skand. Akt., 11:141-180.
M. A. Stephens (1974). Edf statistics for goodness of fit and some comparisons. Journal of the American Statistical Association, 69(347): 730-737.
R. E. von Mises (1928). Wahrscheinlichkeit, Statistik und Wahrheit. Julius Springer, Vienna, Austria.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | x3 <- sample(1:10, 25, replace=TRUE)
# Using ecdf() to specify a discrete distribution:
if (require(ks.test, quietly=TRUE)) {
ks.test(x3, ecdf(1:10))
} else {
cat(paste("See package ks.test for a revised ks.test()",
"handling discrete distributions.\n"))
}
cvm.test(x3, ecdf(1:10))
# Using step() to specify the same discrete distribution:
myfun <- stepfun(1:10, cumsum(c(0, rep(0.1, 10))))
if (require(ks.test, quietly=TRUE)) ks.test(x3, myfun)
cvm.test(x3, myfun)
# Usage of U2 for cyclical distributions (note U2 unchanged, but W2 not)
set.seed(1)
y <- sample(1:4, 20, replace=TRUE)
cvm.test(y, ecdf(1:4), type='W2')
cvm.test(y, ecdf(1:4), type='U2')
z <- y
cvm.test(z, ecdf(1:4), type='W2')
cvm.test(z, ecdf(1:4), type = 'U2')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.