Title: | Chacko Test for Order-Restriction with Permutation |
---|---|
Description: | Implements an extension of the Chacko chi-square test for ordered vectors (Chacko, 1966, <https://www.jstor.org/stable/25051572>). Our extension brings the Chacko test to the computer age by implementing a permutation test to offer a numeric estimate of the p-value, which is particularly useful when the analytic solution is not available. |
Authors: | Waldir Leoncio [aut, cre] , Graeme Ruxton [aut], Morten Wang Fagerland [aut] |
Maintainer: | Waldir Leoncio <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.1.9000 |
Built: | 2024-11-17 05:40:46 UTC |
Source: | https://github.com/ocbe-uio/permchacko |
Prints package version number and welcome message on package load
.onAttach(libname, pkgname)
.onAttach(libname, pkgname)
libname |
library location. See |
pkgname |
package name. See |
Table of . Gives the values of
for
equal sample sizes and
.
chacko63_tab1
chacko63_tab1
An object of class matrix
(inherits from array
) with 10 rows and 8 columns.
Chacko, V. J. (1963). Testing homogeneity against ordered alternatives. The Annals of Mathematical Statistics, 945-956.
A multinomial example with 5 cell frequencies
chacko66_sec3
chacko66_sec3
An object of class integer
of length 5.
Chacko, V. J. (1966). Modified chi-square test for ordered alternatives. Sankhyā: The Indian Journal of Statistics, Series B, 185-190.
A plate with the humidity values continuously decreasing was divided into 10 equal parts and 20 termites introduced on each part. The number of termites counted as a specified time interval on each of the 10 parts of the plate are shown in the dataset
chacko66_sec5
chacko66_sec5
An object of class integer
of length 10.
Chacko, V. J. (1966). Modified chi-square test for ordered alternatives. Sankhyā: The Indian Journal of Statistics, Series B, 185-190.
The Chacko test for order-restriction with permutation test
permChacko(x, n_perm = 1000L, verbosity = 0)
permChacko(x, n_perm = 1000L, verbosity = 0)
x |
vector of numeric values |
n_perm |
number of permutations to calculate the p-value numerically |
verbosity |
if |
A list containing the test statistic, p-values (analytic, numeric and
tabular, when available), the number of permutations performed, the original
data and the reduced data. Use names()
and str()
on the output for more
details.
Chacko, V. J. (1963). Testing homogeneity against ordered alternatives. The Annals of Mathematical Statistics, 945-956.
Chacko, V. J. (1966). Modified chi-square test for ordered alternatives. Sankhyā: The Indian Journal of Statistics, Series B, 185-190.
ruxton221207 <- c(6, 8, 4, 7, 3) chacko66_sec3 <- c(10L, 16L, 14L, 12L, 18L) chacko66_sec5 <- c(12L, 14L, 18L, 16L, 22L, 20L, 18L, 24L, 26L, 30L) permChacko(ruxton221207) permChacko(chacko66_sec3) permChacko(chacko66_sec5)
ruxton221207 <- c(6, 8, 4, 7, 3) chacko66_sec3 <- c(10L, 16L, 14L, 12L, 18L) chacko66_sec5 <- c(12L, 14L, 18L, 16L, 22L, 20L, 18L, 24L, 26L, 30L) permChacko(ruxton221207) permChacko(chacko66_sec3) permChacko(chacko66_sec5)
This function implements the ordering process described in Chacko (1963) and Chacko (1966).
reduceVector(x, verbosity = 0L)
reduceVector(x, verbosity = 0L)
x |
a vector of numeric values |
verbosity |
a natural number indicating the amount of output to print |
A list containing the original vector, the reduced vector, their
weights and the number of reductions performed. Use names()
and str()
on the output for more details.
Waldir Leoncio
reduceVector(c(10, 16, 14, 12, 18)) reduceVector(c(10, 8, 4, 2, 1)) reduceVector(chacko66_sec3) reduceVector(chacko66_sec5) reduceVector(chacko66_sec5, verbosity = 1)
reduceVector(c(10, 16, 14, 12, 18)) reduceVector(c(10, 8, 4, 2, 1)) reduceVector(chacko66_sec3) reduceVector(chacko66_sec5) reduceVector(chacko66_sec5, verbosity = 1)
A simple example showing how a vector can be reduced to one element.
ruxton221207
ruxton221207
An object of class numeric
of length 5.