Performs four tasks:
Selects the appropriate methods for a signed-rank test.
Selects the appropriate methods for a confidence interval.
Checks for invalid data before continuing with calculating test results.
Calculates the number of tied values among the ranked absolute differences.
srt_method(x, test_class = "auto")list
(named list)
The object returned by srt_ranks().
(Scalar character)
This argument should only be used inside .zd() (asymptotic test inversion for CI), for speed, and should be left to the default value in an 'srt pipeline'.
Must be one of "auto", "wilcoxon", "shift", or "asymptotic".
If "auto" (default), the test class class will automatically be chosen based on properties of the data and x$call$distribution.
Otherwise, the function will return early with class set to test_class.
The signed-rank method is chosen by:
If ties are absent and zeros are absent, the exact null distribution of \(W^+\) depends only on \(n_{\text{signed}} = |\mathcal{I}_{\neq 0}|\) and can be obtained from stats::psignrank() or stats::qsignrank().
If ties are present or when zeros are present, the exact null distribution is the distribution of a random subset-sum of the ranks weights.
Methods such as exactRankTests::pperm() or exactRankTests::qperm() are appropriate.
For normal approximations, the mean and variance of \(W^+\) under the symmetry null are \(\mathrm{E}(W^+) = \tfrac{1}{2}\sum r_i\) and \(\mathrm{Var}(W^+) = \tfrac{1}{4}\sum r_i^2\) computed over ranks.
The srt pipeline uses two intermediate classes for internal routing of calculations.
The test class ("wilcoxon", "shift", or "asymptotic") is determined by properties of the data and x$call$distribution.
The confidence interval class ("inversion", "bootstrap", "none") is determined by x$call$conf_level and x$call$conf_method.
The final user facing result class is either srt or rdt, determined by the calling function.