org.statcato.statistics.inferential.nonparametrics
Class WilcoxonRankSumTest
- java.lang.Object
-
- org.statcato.statistics.inferential.nonparametrics.WilcoxonRankSumTest
-
public class WilcoxonRankSumTest extends java.lang.ObjectWilcoxon Rank Sum test. A nonparametic test that uses ranks of samples from two independent populations to test a claim about the medians of two populations. The two independent samples are combined into one sample, are sorted in ascending order and are ranked based on its place in the one sample. The sum of the ranks corresponding to one of the two samples are computed and is used as test statistics.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field and Description doublesignificanceSignificance of the test.
-
Constructor Summary
Constructors Constructor and Description WilcoxonRankSumTest(java.util.Vector<java.lang.Double> data1, java.util.Vector<java.lang.Double> data2, int testType, double significance)Constructor, given two samples of data values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecriticalValue_R()doublegetRankSum(java.util.Vector<java.lang.Double> data1, java.util.Vector<java.lang.Double> data2)Returns the rank sum, which is the sum of ranks for the first sample.doublemu_R()Returns the mean of the distribution of rank sum, mu = n1 * (n1 + n2 + 1) / 2.doublepValue_R()Returns the p-value.doublesigma_R()Returns the standard deviation of the distribution of rank sum, sigma = (n1 * n2 * (n1 + n2 + 1) / 12)^0.5doubletestStatistic_R()Returns the test statistic z = (R - mu) / sigma, where R is the rank sum of the first same, mu the mean of the distribution of rank sum, and sigma the standard deviatioin of the distribution of rank sum.java.lang.StringtoString()
-
-
-
Constructor Detail
-
WilcoxonRankSumTest
public WilcoxonRankSumTest(java.util.Vector<java.lang.Double> data1, java.util.Vector<java.lang.Double> data2, int testType, double significance)Constructor, given two samples of data values.- Parameters:
data1- vector of double values (sample 1)data2- vector of double values (sample 2)testMedian- hypothesized mediantestType- type of alternative hypothesis
-
-
Method Detail
-
testStatistic_R
public double testStatistic_R()
Returns the test statistic z = (R - mu) / sigma, where R is the rank sum of the first same, mu the mean of the distribution of rank sum, and sigma the standard deviatioin of the distribution of rank sum.- Returns:
- test statistic z
-
mu_R
public double mu_R()
Returns the mean of the distribution of rank sum, mu = n1 * (n1 + n2 + 1) / 2.- Returns:
- mean
-
sigma_R
public double sigma_R()
Returns the standard deviation of the distribution of rank sum, sigma = (n1 * n2 * (n1 + n2 + 1) / 12)^0.5- Returns:
- standard deviation
-
pValue_R
public double pValue_R()
Returns the p-value.- Returns:
- p-value
-
criticalValue_R
public double criticalValue_R()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getRankSum
public double getRankSum(java.util.Vector<java.lang.Double> data1, java.util.Vector<java.lang.Double> data2)Returns the rank sum, which is the sum of ranks for the first sample. Ranks are computed after the two samples are combined and sorted in ascending order.- Parameters:
data- vector of Double values- Returns:
- rank sum
-
-
DMelt 3.0 © DataMelt by jWork.ORG