Learn R Programming

LearnNonparam (version 1.2.7)

PairedDifference: Paired Comparison Based on Differences

Description

Performs differences based paired comparison on samples.

Arguments

Super classes

LearnNonparam::PermuTest -> LearnNonparam::TwoSampleTest -> LearnNonparam::TwoSamplePairedTest -> PairedDifference

Active bindings

correct

Whether to apply continuity correction when scoring is set to "rank".

Methods

Public methods

Inherited methods


Method new()

Create a new PairedDifference object.

Usage

PairedDifference$new(
  type = c("permu", "asymp"),
  method = c("with_zeros", "without_zeros"),
  scoring = c("none", "rank", "vw", "expon"),
  alternative = c("two_sided", "less", "greater"),
  null_value = 0,
  n_permu = 10000,
  correct = TRUE
)

Arguments

type

a character string specifying the way to calculate the p-value.

method

a character string specifying the method of ranking data in computing adjusted signed scores for tied data, must be one of "with_zeros" (default) or "without_zeros".

scoring

a character string specifying the scoring system.

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 0, all permutations will be used.

correct

a logical indicating whether to apply continuity correction in the normal approximation for the p-value when scoring is set to "rank".

Returns

A PairedDifference object.

Examples

Run this code
pmt(
    "paired.difference",
    alternative = "greater", scoring = "none", n_permu = 0
)$test(Table4.1.1)$print()

pmt(
    "paired.difference", n_permu = 0
)$test(Table4.1.3)$print()

t <- pmt(
    "paired.difference", scoring = "rank",
    alternative = "greater", n_permu = 0
)$test(Table4.1.1)$print()

t$type <- "asymp"
t

Run the code above in your browser using DataLab