Learn R Programming

LearnNonparam (version 1.2.3)

Difference: Two-Sample Test Based on Mean or Median

Description

Performs mean/median based two-sample test on samples.

Arguments

Super classes

LearnNonparam::PermuTest -> LearnNonparam::TwoSampleTest -> LearnNonparam::TwoSampleLocationTest -> Difference

Methods

Public methods

Inherited 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

method

a character string specifying whether to use the mean or the median.

alternative

a character string specifying the alternative hypothesis.

null_value

a number indicating the true value of the location shift.

n_permu

an integer indicating number of permutations for the permutation distribution. If set to zero (default) then all permutations are used.

Returns

A Difference object.

Examples

Run this code
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)
)

pmt(
    "twosample.difference", method = "mean",
    alternative = "greater", n_permu = 1000
)$test(Table2.3.1)$print()

Run the code above in your browser using DataLab