Performs two-sample sign test on samples.
Super classes
LearnNonparam::PermuTest
-> LearnNonparam::TwoSampleTest
-> LearnNonparam::TwoSamplePairedTest
-> Sign
Methods
Method new()
Create a new Sign
object.
Arguments
type
a character string specifying the way to calculate the p-value.
alternative
a character string specifying the alternative hypothesis.
n_permu
an integer indicating number of permutations for the permutation distribution. If set to
0
, all permutations will be used.correct
a logical indicating whether to apply continuity correction in the normal approximation for the p-value.
Examples
t <- pmt(
"paired.sign",
alternative = "greater", n_permu = 0
)$test(
rep(c(+1, -1), c(12, 5)), rep(0, 17)
)$print()
#>
#> Two-Sample Sign Test
#>
#> scoring: none type: permu(131072) method: default
#> statistic = 12, p-value = 0.07173157
#> alternative hypothesis: greater
t$type <- "asymp"
t
#>
#> Two-Sample Sign Test
#>
#> scoring: none type: asymp method: default
#> statistic = 12, p-value = 0.07280505
#> alternative hypothesis: greater