CARL {CMHNPA}R Documentation

CARL Test

Description

CARL returns the test statistic and p-value for the aligned RL test with empirically fitted degrees of freedom.

Usage

CARL(
  y,
  treatment,
  block1,
  block2,
  n_components = 0,
  n_permutations = 0,
  treatment_scores = NULL,
  sig_digits = 4,
  verbose = FALSE
)

Arguments

y

a numeric vector for the response variable.

treatment

a vector giving the treatment type for the corresponding elements of y.

block1

a vector giving the first blocking variable for the corresponding elements of y.

block2

a vector giving the second blocking variable for the corresponding elements of y.

n_components

the number of polynomial components you wish to test. The maximum number of components is the number of treatments less one. If the number of components requested is less than t-2, a remainder component is created.

n_permutations

the number of permutations you wish to run.

treatment_scores

the scores to be applied to the treatment groups. If not declared these will be set automatically and should be checked.

sig_digits

the number of significant digits the output should show.

verbose

flag for turning on the status bar for permutation tests.

Details

This test is applicable to Latin square designs and is recommended over the RL and ARL test. The test uses t+1 as the degrees of freedom of the chi-squared null distribution and results in appropriate test sizes as well as good power.

Value

The CARL test statistic adjusted for ties together with the associated p-value using a chi-squared distribution with t+1 degrees of freedom.

References

Rayner, J.C.W and Livingston, G. C. (2022). An Introduction to Cochran-Mantel-Haenszel Testing and Nonparametric ANOVA. Wiley.

See Also

ARL() PARL()

Examples

attach(peanuts)
CARL(y = yield, treatment = treatment, block1 = row, block2 = col)


[Package CMHNPA version 1.1.1 Index]