Ejemplo n.º 1
0
 /*  33:    */
 /*  34:    */ public static boolean homoscedasticTTest(
     double[] sample1, double[] sample2, double alpha)
     /*  35:    */ throws NullArgumentException, NumberIsTooSmallException, OutOfRangeException,
         MaxCountExceededException
       /*  36:    */ {
   /*  37: 83 */ return T_TEST.homoscedasticTTest(sample1, sample2, alpha);
   /*  38:    */ }
Ejemplo n.º 2
0
 /* 129:    */
 /* 130:    */ public static boolean tTest(
     StatisticalSummary sampleStats1, StatisticalSummary sampleStats2, double alpha)
     /* 131:    */ throws NullArgumentException, NumberIsTooSmallException, OutOfRangeException,
         MaxCountExceededException
       /* 132:    */ {
   /* 133:228 */ return T_TEST.tTest(sampleStats1, sampleStats2, alpha);
   /* 134:    */ }
Ejemplo n.º 3
0
 /*  45:    */
 /*  46:    */ public static double homoscedasticTTest(
     StatisticalSummary sampleStats1, StatisticalSummary sampleStats2)
     /*  47:    */ throws NullArgumentException, NumberIsTooSmallException,
         MaxCountExceededException
       /*  48:    */ {
   /*  49:100 */ return T_TEST.homoscedasticTTest(sampleStats1, sampleStats2);
   /*  50:    */ }
Ejemplo n.º 4
0
 /* 135:    */
 /* 136:    */ public static double tTest(
     StatisticalSummary sampleStats1, StatisticalSummary sampleStats2)
     /* 137:    */ throws NullArgumentException, NumberIsTooSmallException,
         MaxCountExceededException
       /* 138:    */ {
   /* 139:238 */ return T_TEST.tTest(sampleStats1, sampleStats2);
   /* 140:    */ }
Ejemplo n.º 5
0
  public void compairWise(
      ArrayList<Double> aList, ArrayList<Double> bList, String aGroup, String bGroup) {
    // a should be the small
    // b should be the larger

    ArrayList<Integer> randomNumberList = new ArrayList<Integer>();
    double a[] = new double[aList.size()];
    double b[] = new double[aList.size()];

    for (int i = 0; i < aList.size(); ) {
      a[i] = aList.get(i);
      while (true) {
        int randomIndex = r.nextInt(bList.size());
        if (!randomNumberList.contains(randomIndex)) {
          randomNumberList.add(randomIndex);
          b[i] = bList.get(randomIndex);
          break;
        }
      }
      i++;
    }

    randomNumberList.clear();

    /*for(int i = 0; i<aList.size();){

    	System.out.println("a"+a[i]+"b"+b[i]);

    }*/

    int df = aList.size() + aList.size() - 2;
    TTest ttest = new TTest();
    System.out.println("-----------------------------");
    System.out.println(bGroup + " Vs " + aGroup);

    System.out.println(aGroup + " Mean:" + getMean(a));
    System.out.println(aGroup + " Standard Deviation:" + getStdDev(a));
    System.out.println(bGroup + " Mean:" + getMean(b));
    System.out.println(bGroup + " Standard Deviation:" + getStdDev(b));

    System.out.println("t_statistic:" + ttest.t(a, b));
    System.out.println("p value:" + ttest.tTest(a, b));
    System.out.println("DF:" + df);
    double corr = new PearsonsCorrelation().correlation(a, b);
    System.out.println("Correlation: " + corr);
    System.out.println("\n\n");
  }
Ejemplo n.º 6
0
 /*  57:    */
 /*  58:    */ public static boolean pairedTTest(double[] sample1, double[] sample2, double alpha)
     /*  59:    */ throws NullArgumentException, NoDataException, DimensionMismatchException,
         NumberIsTooSmallException, OutOfRangeException, MaxCountExceededException
       /*  60:    */ {
   /*  61:119 */ return T_TEST.pairedTTest(sample1, sample2, alpha);
   /*  62:    */ }
Ejemplo n.º 7
0
 /*  63:    */
 /*  64:    */ public static double pairedTTest(double[] sample1, double[] sample2)
     /*  65:    */ throws NullArgumentException, NoDataException, DimensionMismatchException,
         NumberIsTooSmallException, MaxCountExceededException
       /*  66:    */ {
   /*  67:128 */ return T_TEST.pairedTTest(sample1, sample2);
   /*  68:    */ }
Ejemplo n.º 8
0
 /*  93:    */
 /*  94:    */ public static boolean tTest(double mu, double[] sample, double alpha)
     /*  95:    */ throws NullArgumentException, NumberIsTooSmallException, OutOfRangeException,
         MaxCountExceededException
       /*  96:    */ {
   /*  97:170 */ return T_TEST.tTest(mu, sample, alpha);
   /*  98:    */ }
Ejemplo n.º 9
0
 /*  51:    */
 /*  52:    */ public static double pairedT(double[] sample1, double[] sample2)
     /*  53:    */ throws NullArgumentException, NoDataException, DimensionMismatchException,
         NumberIsTooSmallException
       /*  54:    */ {
   /*  55:109 */ return T_TEST.pairedT(sample1, sample2);
   /*  56:    */ }
Ejemplo n.º 10
0
 /*  99:    */
 /* 100:    */ public static double tTest(double mu, double[] sample)
     /* 101:    */ throws NullArgumentException, NumberIsTooSmallException,
         MaxCountExceededException
       /* 102:    */ {
   /* 103:179 */ return T_TEST.tTest(mu, sample);
   /* 104:    */ }
Ejemplo n.º 11
0
 /*  39:    */
 /*  40:    */ public static double homoscedasticTTest(double[] sample1, double[] sample2)
     /*  41:    */ throws NullArgumentException, NumberIsTooSmallException,
         MaxCountExceededException
       /*  42:    */ {
   /*  43: 91 */ return T_TEST.homoscedasticTTest(sample1, sample2);
   /*  44:    */ }
Ejemplo n.º 12
0
 /*  81:    */
 /*  82:    */ public static double t(double[] sample1, double[] sample2)
     /*  83:    */ throws NullArgumentException, NumberIsTooSmallException
       /*  84:    */ {
   /*  85:152 */ return T_TEST.t(sample1, sample2);
   /*  86:    */ }
Ejemplo n.º 13
0
  public void compare() {

    compairWise(toplevelList.get("Asian"), toplevelList.get("White"), "Asian", "White");
    compairWise(
        toplevelList.get("AfricanAmerican"), toplevelList.get("White"), "AfricanAmerican", "White");
    compairWise(toplevelList.get("Hispanic"), toplevelList.get("White"), "Hispanic", "White");

    compairWise(list.get("AsianM"), list.get("WhiteM"), "Asian Male", "White Male");
    compairWise(list.get("AsianF"), list.get("WhiteF"), "Asian Female", "White Female");

    compairWise(
        list.get("AfricanAmericanM"), list.get("WhiteM"), "AfricanAmerican Male", "White Male");
    compairWise(
        list.get("AfricanAmericanF"), list.get("WhiteF"), "AfricanAmerican Female", "White Female");

    compairWise(list.get("HispanicM"), list.get("WhiteM"), "Hispanic Male", "White Male");
    compairWise(list.get("HispanicF"), list.get("WhiteF"), "Hispanic Female", "White Female");

    white = new double[nonWhiteSize];
    nonWhite = new double[nonWhiteSize];
    ArrayList<Integer> randomNumberList = new ArrayList<Integer>();

    for (int i = 0; i < nonWhiteSize; ) {

      while (true) {
        int randomIndex = r.nextInt(whiteSize);
        if (!randomNumberList.contains(randomIndex)) {
          randomNumberList.add(randomIndex);
          white[i] = toplevelList.get("White").get(randomIndex);
          break;
        }
      }
      i++;
    }

    /*for(int i = 0; i<nonWhiteSize;){
    	System.out.println("Random Number:"+randomNumberList.get(i)+", white["+i+"]: "+ white[i]);
    	i++;
    }*/

    for (int i = 0; i < toplevelList.get("AfricanAmerican").size(); i++) {
      nonWhite[i] = toplevelList.get("AfricanAmerican").get(i);
    }

    int j = 0;
    for (int i = toplevelList.get("AfricanAmerican").size();
        i < toplevelList.get("AfricanAmerican").size() + toplevelList.get("Asian").size();
        i++) {
      nonWhite[i] = toplevelList.get("Asian").get(j);
      j++;
    }

    j = 0;
    for (int i = toplevelList.get("AfricanAmerican").size() + toplevelList.get("Asian").size();
        i < nonWhiteSize;
        i++) {
      nonWhite[i] = toplevelList.get("Hispanic").get(j);
      j++;
    }

    int df = (int) (nonWhiteSize + nonWhiteSize - 2);
    TTest ttest = new TTest();
    System.out.println("-----------------------------");
    System.out.println("White Vs Non-White");

    System.out.println("White Mean:" + getMean(white));
    System.out.println("White Standard Deviation:" + getStdDev(white));
    System.out.println("Non-White Mean:" + getMean(nonWhite));
    System.out.println("Non-White Standard Deviation:" + getStdDev(nonWhite));

    System.out.println("t_statistic:" + ttest.t(white, nonWhite));
    System.out.println("p value:" + ttest.tTest(white, nonWhite));
    System.out.println("DF:" + df);
    double corr = new PearsonsCorrelation().correlation(white, nonWhite);
    System.out.println("Correlation: " + corr);
  }
Ejemplo n.º 14
0
 /*  69:    */
 /*  70:    */ public static double t(double mu, double[] observed)
     /*  71:    */ throws NullArgumentException, NumberIsTooSmallException
       /*  72:    */ {
   /*  73:136 */ return T_TEST.t(mu, observed);
   /*  74:    */ }
Ejemplo n.º 15
0
 /* 105:    */
 /* 106:    */ public static boolean tTest(double mu, StatisticalSummary sampleStats, double alpha)
     /* 107:    */ throws NullArgumentException, NumberIsTooSmallException, OutOfRangeException,
         MaxCountExceededException
       /* 108:    */ {
   /* 109:189 */ return T_TEST.tTest(mu, sampleStats, alpha);
   /* 110:    */ }
Ejemplo n.º 16
0
 /* 123:    */
 /* 124:    */ public static double tTest(double[] sample1, double[] sample2)
     /* 125:    */ throws NullArgumentException, NumberIsTooSmallException,
         MaxCountExceededException
       /* 126:    */ {
   /* 127:217 */ return T_TEST.tTest(sample1, sample2);
   /* 128:    */ }
Ejemplo n.º 17
0
 /* 117:    */
 /* 118:    */ public static boolean tTest(double[] sample1, double[] sample2, double alpha)
     /* 119:    */ throws NullArgumentException, NumberIsTooSmallException, OutOfRangeException,
         MaxCountExceededException
       /* 120:    */ {
   /* 121:208 */ return T_TEST.tTest(sample1, sample2, alpha);
   /* 122:    */ }
Ejemplo n.º 18
0
 /* 111:    */
 /* 112:    */ public static double tTest(double mu, StatisticalSummary sampleStats)
     /* 113:    */ throws NullArgumentException, NumberIsTooSmallException,
         MaxCountExceededException
       /* 114:    */ {
   /* 115:198 */ return T_TEST.tTest(mu, sampleStats);
   /* 116:    */ }
Ejemplo n.º 19
0
 /*  75:    */
 /*  76:    */ public static double t(double mu, StatisticalSummary sampleStats)
     /*  77:    */ throws NullArgumentException, NumberIsTooSmallException
       /*  78:    */ {
   /*  79:144 */ return T_TEST.t(mu, sampleStats);
   /*  80:    */ }
Ejemplo n.º 20
0
 /*  21:    */
 /*  22:    */ public static double homoscedasticT(double[] sample1, double[] sample2)
     /*  23:    */ throws NullArgumentException, NumberIsTooSmallException
       /*  24:    */ {
   /*  25: 64 */ return T_TEST.homoscedasticT(sample1, sample2);
   /*  26:    */ }
Ejemplo n.º 21
0
 /*  87:    */
 /*  88:    */ public static double t(
     StatisticalSummary sampleStats1, StatisticalSummary sampleStats2)
     /*  89:    */ throws NullArgumentException, NumberIsTooSmallException
       /*  90:    */ {
   /*  91:161 */ return T_TEST.t(sampleStats1, sampleStats2);
   /*  92:    */ }
Ejemplo n.º 22
0
 /*  27:    */
 /*  28:    */ public static double homoscedasticT(
     StatisticalSummary sampleStats1, StatisticalSummary sampleStats2)
     /*  29:    */ throws NullArgumentException, NumberIsTooSmallException
       /*  30:    */ {
   /*  31: 73 */ return T_TEST.homoscedasticT(sampleStats1, sampleStats2);
   /*  32:    */ }