The Chacko test for order-restriction with permutation test

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)
#> 
#>         Chacko Test for Order-restriction with Permutation Test
#> 
#> Null hypothesis           : p1 == p2 == p3 == p4 == p5
#> Alternative hypothesis    : p1 <= p2 <= p3 <= p4 <= p5
#> 
#> Test statistic (chisq_bar): 0.000000
#> p-values:
#>   Analytic p-value        : NA
#>   Numeric p-value         : 1.000000 (1000 permutations)
#>   Numeric mid-p value     : 0.899000 (1000 permutations)
#>   Tabular p-value         : 0.800000
permChacko(chacko66_sec3)
#> 
#>         Chacko Test for Order-restriction with Permutation Test
#> 
#> Null hypothesis           : p1 == p2 == p3 == p4 == p5
#> Alternative hypothesis    : p1 <= p2 <= p3 <= p4 <= p5
#> 
#> Test statistic (chisq_bar): 2.285714
#> p-values:
#>   Analytic p-value        : 0.318907
#>   Numeric p-value         : 0.186000 (1000 permutations)
#>   Numeric mid-p value     : 0.182500 (1000 permutations)
#>   Tabular p-value         : 0.196052
permChacko(chacko66_sec5)
#> 
#>         Chacko Test for Order-restriction with Permutation Test
#> 
#> Null hypothesis           : p1 == p2 == ... == p9 == p10
#> Alternative hypothesis    : p1 <= p2 <= ... <= p9 <= p10
#> 
#> Test statistic (chisq_bar): 13.500000
#> p-values:
#>   Analytic p-value        : 0.035748
#>   Numeric p-value         : 0.002000 (1000 permutations)
#>   Numeric mid-p value     : 0.002000 (1000 permutations)
#>   Tabular p-value         : 0.002294