Title: | Chacko Test for Order-Restriction with Permutation |
Version: | 1.0.1 |
Date: | 2024-09-18 |
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. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Imports: | methods |
Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
URL: | https://ocbe-uio.github.io/permChacko/ |
BugReports: | https://github.com/ocbe-uio/permChacko/issues |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2024-09-18 06:43:42 UTC; waldir |
Author: | Waldir Leoncio |
Maintainer: | Waldir Leoncio <w.l.netto@medisin.uio.no> |
Repository: | CRAN |
Date/Publication: | 2024-09-18 07:00:02 UTC |
permChacko: 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.
Author(s)
Maintainer: Waldir Leoncio w.l.netto@medisin.uio.no (ORCID)
Authors:
Graeme Ruxton
Morten Wang Fagerland morten.fagerland@medisin.uio.no
See Also
Useful links:
Prints welcome message on package attachment
Description
Prints package version number and welcome message on package load
Usage
.onAttach(libname, pkgname)
Arguments
libname |
library location. See |
pkgname |
package name. See |
Table I
Description
Table of p_{m, k}
. Gives the values of p_{m, k}
for
equal sample sizes and k = 3, 4, \ldots, 10
.
Usage
chacko63_tab1
Format
An object of class matrix
(inherits from array
) with 10 rows and 8 columns.
References
Chacko, V. J. (1963). Testing homogeneity against ordered alternatives. The Annals of Mathematical Statistics, 945-956.
Chacko (1966), section 3
Description
A multinomial example with 5 cell frequencies
Usage
chacko66_sec3
Format
An object of class integer
of length 5.
References
Chacko, V. J. (1966). Modified chi-square test for ordered alternatives. Sankhyā: The Indian Journal of Statistics, Series B, 185-190.
Chacko (1966), section 5
Description
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
Usage
chacko66_sec5
Format
An object of class integer
of length 10.
References
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
Description
The Chacko test for order-restriction with permutation test
Usage
permChacko(x, n_perm = 1000L, verbosity = 0)
Arguments
x |
vector of numeric values |
n_perm |
number of permutations to calculate the p-value numerically |
verbosity |
if |
Value
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.
References
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.
Examples
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)
Reduce a vector using the ordering process
Description
This function implements the ordering process described in Chacko (1963) and Chacko (1966).
Usage
reduceVector(x, verbosity = 0L)
Arguments
x |
a vector of numeric values |
verbosity |
a natural number indicating the amount of output to print |
Value
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.
Author(s)
Waldir Leoncio
Examples
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)
Example by Graeme Ruxton
Description
A simple example showing how a vector can be reduced to one element.
Usage
ruxton221207
Format
An object of class numeric
of length 5.