Performs mean/median based two-sample test on samples.
Super classes
LearnNonparam::PermuTest -> LearnNonparam::TwoSampleTest -> LearnNonparam::TwoSampleLocationTest -> Difference
Methods
Method new()
Create a new Difference object.
Usage
Difference$new(
method = c("mean", "median"),
alternative = c("two_sided", "less", "greater"),
null_value = 0,
n_permu = 10000
)Arguments
methoda character string specifying whether to use the mean or the median.
alternativea character string specifying the alternative hypothesis.
null_valuea number indicating the true value of the location shift.
n_permuan integer indicating number of permutations for the permutation distribution. If set to
0, all permutations will be used.
Examples
pmt(
"twosample.difference", method = "mean",
alternative = "greater", n_permu = 0
)$test(Table2.1.1)$print()$plot(
style = "graphic", breaks = seq(-20, 25, length.out = 9)
)
#>
#> Two-Sample Test Based on Mean or Median
#>
#> scoring: none type: permu(35) method: mean
#> statistic = 16.16667, p-value = 0.05714286
#> alternative hypothesis: greater
pmt(
"twosample.difference", method = "mean",
alternative = "greater", n_permu = 1000
)$test(Table2.3.1)$print()
#>
#> Two-Sample Test Based on Mean or Median
#>
#> scoring: none type: permu(1000) method: mean
#> statistic = 1.675, p-value = 0.196 (± 0.02460391 at 95% confidence)
#> alternative hypothesis: greater