Two Independent Sample Wilcoxon Test

From SOCR
Jump to: navigation, search
/*

July 2006. Annie Che <chea@stat.ucla.edu>. UCLA Statistics.

Source of example data: 
Mathematical Statistics and Data Analysis, John Rice, Second Edition. 
Page 390, example A, determination of the laten heat of fusion of ice.

*/
package edu.ucla.stat.SOCR.analyses.example;

import java.util.HashMap;
import edu.ucla.stat.SOCR.analyses.data.Data;
import edu.ucla.stat.SOCR.analyses.result.TwoIndependentWilcoxonResult;


public class TwoIndependentWilcoxonExample {
	public static void main(String args[]) {

		double[] a = 
                {79.98, 80.04, 80.02, 80.04, 80.03, 80.03, 
                80.04, 79.97, 80.05, 80.03, 80.02, 80.00, 80.02};

		double[] b = 
                {80.02, 79.94, 79.98, 79.97, 79.97, 80.03, 79.95, 79.97};

		// you'll need to instantiate a data instance first.
		Data data = new Data();


		// then use the following line to get the result.
		try {
			TwoIndependentWilcoxonResult result = 
                        (TwoIndependentWilcoxonResult)data.modelTwoIndependentWilcoxon(a,b);
                       
                         if (result != null) {
		                // Getting the model's parameter estiamtes and statistics.
				double meanX = result.getMeanX();
				double meanY = result.getMeanY();
				System.out.println("meanX = " + meanX);
				System.out.println("meanY = " + meanY);
				double rankSumSmall = result.getRankSumSmallerGroup();
				double rankSumLarge = result.getRankSumLargerGroup();
				System.out.println("rankSumSmall = " + rankSumSmall);
				System.out.println("rankSumLarge = " + rankSumLarge);
				double uStatSmall = result.getUStatSmallerGroup();
				double uStatLarge = result.getUStatLargerGroup();
				System.out.println("uStatSmall = " + uStatSmall);
				System.out.println("uStatLarge = " + uStatLarge);


				double meanU = result.getMeanU();
				double varU = result.getVarianceU();
				System.out.println("meanU = " + meanU);
				System.out.println("varU = " + varU);

				double zScore = result.getZScore();
				String pValue = result.getPValue();
				boolean isLargeSample = result.isLargeSample();

				System.out.println("zScore = " + zScore);
				System.out.println("pValue = " + pValue);
				System.out.println("isLargeSample = " + isLargeSample);


			}
		} catch (Exception e) {
			System.out.println(e);
		}
	}
}




Translate this page:

(default)
Uk flag.gif

Deutsch
De flag.gif

Español
Es flag.gif

Français
Fr flag.gif

Italiano
It flag.gif

Português
Pt flag.gif

日本語
Jp flag.gif

България
Bg flag.gif

الامارات العربية المتحدة
Ae flag.gif

Suomi
Fi flag.gif

इस भाषा में
In flag.gif

Norge
No flag.png

한국어
Kr flag.gif

中文
Cn flag.gif

繁体中文
Cn flag.gif

Русский
Ru flag.gif

Nederlands
Nl flag.gif

Ελληνικά
Gr flag.gif

Hrvatska
Hr flag.gif

Česká republika
Cz flag.gif

Danmark
Dk flag.gif

Polska
Pl flag.png

România
Ro flag.png

Sverige
Se flag.gif