import javastat.StatisticalTests;

 

/**

 *

 * <p>Example: class StatisticalTests.</p>

 */

 

double[] oneSampMeanTestData = {7, 8, 10, 8, 6, 9, 6, 7, 7, 8, 9, 8};

double[] twoSampMeansTestData1 = {300, 280, 344, 385, 372, 360, 288,

                                 321, 376, 290, 301, 283};

double[] twoSampMeansTestData2 = {276, 222, 310, 338, 200, 302, 317,

                                 260, 320, 312, 334, 265};

String[] colvar = {"M", "F", "M", "M", "M", "F", "F", "M", "F", "M",

               "F", "F", "M", "F", "M", "M", "F", "F", "M", "F",

               "M", "F", "F", "F", "F", "F", "M", "F", "M", "F",

               "F", "M", "M", "F", "M", "F", "F", "F", "M", "F",

               "F", "F", "M", "M", "F", "F", "F", "M", "F", "F"};

String[] rowvar = {"Editor", "AE", "Referee", "Editor", "Editor", "AE",

                "AE", "AE", "AE", "Editor",

                "Editor", "AE", "AE", "AE", "Referee", "Referee",

                "AE", "AE", "AE", "Editor",

                "Referee", "Referee", "Editor", "AE", "AE", "AE",

                "Referee", "Editor", "AE", "Referee",

                "Referee", "Referee", "Referee", "AE", "Referee",

                "AE", "Editor", "AE", "Referee", "AE",

                "Editor", "Referee", "Editor", "Referee", "AE", "AE",

                "Referee", "Editor", "Editor", "AE"};

double[][] anovaData = { {6.0, 7.0, 6.0, 8.0}, {8.0, 9.0, 8.0, 10.0},

                      {13.0, 14.0, 15.0} };

double[] time1 = {156, 1040, 59, 329, 268, 638, 1106, 431, 855, 803,

               115, 477, 448};

double[] time2 = {421, 769, 365, 770, 1227, 475, 1129, 464, 1206, 563,

               744, 353, 377};

double[] censor1 = {1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0};

double[] censor2 = {0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0};

Hashtable argument = new Hashtable();

 

dataObj = new Object[]{oneSampMeanTestData};

statObj1 = new javastat.StatisticalTests(argument, dataObj).statisticalAnalysis;

print(statObj1.output.toString());

 

dataObj = new Object[]{twoSampMeansTestData1, twoSampMeansTestData2};

statObj2 = new javastat.StatisticalTests(argument, dataObj).statisticalAnalysis;

print(statObj2.output.toString());

 

dataObj = new Object[]{30, 100};

statObj3 = new javastat.StatisticalTests(argument, dataObj).statisticalAnalysis;

print(statObj3.output.toString());

 

dataObj = new Object[]{36, 150, 30, 100};

statObj4 = new javastat.StatisticalTests(argument, dataObj).statisticalAnalysis;

print(statObj4.output.toString());

 

dataObj = new Object[]{rowvar, colvar};

statObj5 = new javastat.StatisticalTests(argument, dataObj).statisticalAnalysis;

print(statObj5.output.toString());

 

dataObj = anovaData;

statObj6 = new javastat.StatisticalTests(argument, anovaData).

statisticalAnalysis;

print(statObj6.output.toString());

 

dataObj = new Object[]{time1, censor1, time2, censor2};

statObj7 = new javastat.StatisticalTests(argument, dataObj).statisticalAnalysis;

print(statObj7.output.toString());

 

Results:

{TEST_STATISTIC=22.088, POINT_ESTIMATE=7.75,

CONFIDENCE_INTERVAL=[D@1e2c841, POINT_ESTIMATE_SE=0.351,

PVALUE=0.0}

 

{TEST_STATISTIC=2.156, POINT_ESTIMATE=37.0,

CONFIDENCE_INTERVAL=[D@1faa614, POINT_ESTIMATE_SE=17.165,

PVALUE=0.0311}

 

{TEST_STATISTIC=-4.0, POINT_ESTIMATE=0.3, PROPORTION_SE_H0=0.05,

CONFIDENCE_INTERVAL=[D@18ca663, POINT_ESTIMATE_SE=0.05,

PVALUE=6.334E-5}

 

{TEST_STATISTIC=-1.054, POINT_ESTIMATE=-0.06, PROPORTION_H0=0.264,

CONFIDENCE_INTERVAL=[D@83e5f1, POINT_ESTIMATE_SE=0.0569,

PVALUE=0.292, PROPORTION_DIFFERENCE_SE_H0=0.0569}

 

{TEST_STATISTIC=9.013, DEGREE_OF_FREEDOM=2.0, PVALUE=0.0110}

 

{TEST_STATISTIC=49.721, DEGREE_OF_FREEDOM=[D@60029d, PVALUE=3.074E-5}

 

{TEST_STATISTIC=1.766, PVALUE=0.303}