org.statcato.statistics.inferential.nonparametrics
Class WilcoxonSignedRankPValue

java.lang.Object
  extended by org.statcato.statistics.inferential.nonparametrics.WilcoxonSignedRankPValue

public class WilcoxonSignedRankPValue
extends java.lang.Object

A class that computes p-values and critical values for Wilcoxon Signed Rank Test using exact and normal approximation methods.

Since:
1.0
Version:
%I%, %G%
Author:
Margaret Yau

Field Summary
static boolean[] calculated
          One-dimensional array of boolean values indicating whether the p-values for each sample size are calculated.
static int MAX_N
          The maximum sample size calculated using exact method.
static int MAX_SUM
          The maximum rank sum given the maximum sample size.
static double[][] pvalue
          Two-dimensional array of double values representing the cumulative p-values of each rank sum corresponding to the sample size.
static int[][] sum
          Two-dimensional array of integers representing the number of occurrences of each rank sum corresponding to the sample size.
 
Constructor Summary
WilcoxonSignedRankPValue()
          Constructor.
 
Method Summary
static double getCriticalValue(double alpha, int n)
          Returns the critical value corresponding to the given significance and sample size.
static double getPValue(double s, int n)
          Returns the p-value corresponding to the given rank sum and sample size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_N

public static final int MAX_N
The maximum sample size calculated using exact method. Normal approximation is used for sample size greater than this number.

See Also:
Constant Field Values

calculated

public static boolean[] calculated
One-dimensional array of boolean values indicating whether the p-values for each sample size are calculated.


MAX_SUM

public static final int MAX_SUM
The maximum rank sum given the maximum sample size.

See Also:
Constant Field Values

sum

public static int[][] sum
Two-dimensional array of integers representing the number of occurrences of each rank sum corresponding to the sample size. sum[i][j] = number of occurrences of rank sum j for sample size i.


pvalue

public static double[][] pvalue
Two-dimensional array of double values representing the cumulative p-values of each rank sum corresponding to the sample size. pvalue[i][j] = cumulative p-value of rank sum j for sample size i.

Constructor Detail

WilcoxonSignedRankPValue

public WilcoxonSignedRankPValue()
Constructor.

Method Detail

getPValue

public static double getPValue(double s,
                               int n)
Returns the p-value corresponding to the given rank sum and sample size. The exact method is used for sample size <= MAX_N, where as normal approximation is used for sample size > MAX_N.

Parameters:
s - rank sum
n - sample size
Returns:
p-value

getCriticalValue

public static double getCriticalValue(double alpha,
                                      int n)
Returns the critical value corresponding to the given significance and sample size.

Parameters:
alpha - significance
n - sample size
Returns:
critical value