package com.imsl.test.example.stat; import com.imsl.stat.*; import com.imsl.math.*; /** *
* Analyzes the ranks of a data set.
* * In this data from Hinkley (1977) note that the fourth and sixth observations * are tied and that the third and twentieth are tied. * * * @see Code * @see Output */ public class RanksEx1 { public static void main(String args[]) { double x[] = { 0.77, 1.74, 0.81, 1.20, 1.95, 1.20, 0.47, 1.43, 3.37, 2.20, 3.00, 3.09, 1.51, 2.10, 0.52, 1.62, 1.31, 0.32, 0.59, 0.81, 2.81, 1.87, 1.18, 1.35, 4.75, 2.48, 0.96, 1.89, 0.90, 2.05 }; PrintMatrixFormat mf = new PrintMatrixFormat(); mf.setNoRowLabels(); mf.setNoColumnLabels(); Ranks ranks = new Ranks(); double score[] = ranks.getRanks(x); new PrintMatrix("The Ranks of the Observations - " + "Ties Averaged").print(mf, score); System.out.println(); ranks = new Ranks(); ranks.setTieBreaker(Ranks.TIE_HIGHEST); score = ranks.getBlomScores(x); new PrintMatrix("The Blom Scores of the Observations - " + "Highest Score used in Ties").print(mf, score); System.out.println(); ranks = new Ranks(); ranks.setTieBreaker(Ranks.TIE_LOWEST); score = ranks.getTukeyScores(x); new PrintMatrix("The Tukey Scores of the Observations - " + "Lowest Score used in Ties").print(mf, score); System.out.println(); ranks = new Ranks(); ranks.setTieBreaker(Ranks.TIE_RANDOM); Random random = new Random(); random.setSeed(123457); random.setMultiplier(16807); ranks.setRandom(random); score = ranks.getVanDerWaerdenScores(x); new PrintMatrix("The Van Der Waerden Scores of the " + "Observations - Ties untied by Random").print(mf, score); } }