Package 'permChacko'

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-09-18 08:17:29 UTC
Source: https://github.com/ocbe-uio/permchacko

Help Index


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 ?base::.onAttach for details

pkgname

package name. See ?base::.onAttach for details


Table I

Description

Table of pm,kp_{m, k}. Gives the values of pm,kp_{m, k} for equal sample sizes and k=3,4,,10k = 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 TRUE, prints intermediate messages and output

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.