SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.rank.wilcoxon
Class WilcoxonSignedRank

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.test.HypothesisTest
      extended by com.numericalmethod.suanshu.stats.test.rank.wilcoxon.WilcoxonSignedRank

public class WilcoxonSignedRank
extends HypothesisTest

The Wilcoxon signed rank test tests, for the one-sample case, the median of the distribution against a hypothetical median, and for the two-sample case, the equality of median of groups.

Unlike the Student's t-test, the Wilcoxon signed rank test does not assume any distribution of the population.

The R equivalent function is wilcox.test.

See Also:

Field Summary
 double pValue1SidedGreater
          right, one-sided p-value
 double pValue1SidedLess
          left, one-sided p-value
 
Fields inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
k, N, pValue, testStatistics
 
Constructor Summary
WilcoxonSignedRank(double[] sample)
          Perform the Wilcoxon Signed Rank test to test for the equality of medians.
WilcoxonSignedRank(double[] sample1, double[] sample2)
          Perform the Wilcoxon Signed Rank test to test for the equality of medians.
WilcoxonSignedRank(double[] sample1, double[] sample2, double mu, boolean isExact)
          Perform the Wilcoxon Signed Rank test to test for the equality of medians.
WilcoxonSignedRank(double[] sample, int mu)
          Perform the Wilcoxon Signed Rank test to test for the equality of medians.
 
Method Summary
 java.lang.String alternativeHypothesis()
          Get a description of the alternative hypothesis.
 java.lang.String nullHypothesis()
          Get a description of the null hypothesis.
 
Methods inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest
oneSidedPvalue, pValue, rejectNull, testStatistics
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pValue1SidedLess

public final double pValue1SidedLess
left, one-sided p-value


pValue1SidedGreater

public final double pValue1SidedGreater
right, one-sided p-value

Constructor Detail

WilcoxonSignedRank

public WilcoxonSignedRank(double[] sample1,
                          double[] sample2,
                          double mu,
                          boolean isExact)
Perform the Wilcoxon Signed Rank test to test for the equality of medians.

Parameters:
sample1 - sample 1
sample2 - sample 2
mu - the hypothetical median that the distribution is symmetric about
isExact - true if to use the exact distribution; otherwise, normal approximation is used

WilcoxonSignedRank

public WilcoxonSignedRank(double[] sample1,
                          double[] sample2)
Perform the Wilcoxon Signed Rank test to test for the equality of medians.

Parameters:
sample1 - sample 1
sample2 - sample 2

WilcoxonSignedRank

public WilcoxonSignedRank(double[] sample,
                          int mu)
Perform the Wilcoxon Signed Rank test to test for the equality of medians.

Parameters:
sample - a sample
mu - the hypothetical median that the distribution is symmetric about

WilcoxonSignedRank

public WilcoxonSignedRank(double[] sample)
Perform the Wilcoxon Signed Rank test to test for the equality of medians.

Parameters:
sample - a sample
Method Detail

nullHypothesis

public java.lang.String nullHypothesis()
Description copied from class: HypothesisTest
Get a description of the null hypothesis.

Specified by:
nullHypothesis in class HypothesisTest
Returns:
the null hypothesis description
See Also:
Wikipedia: Null hypothesis

alternativeHypothesis

public java.lang.String alternativeHypothesis()
Description copied from class: HypothesisTest
Get a description of the alternative hypothesis.

Specified by:
alternativeHypothesis in class HypothesisTest
Returns:
the alternative hypothesis description
See Also:
Wikipedia: Alternative hypothesis

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.