Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/17/14 11:31:26 (9 years ago)
Author:
ascheibe
Message:

#2031

  • fixed a bug in Cohens d / Hedges g calculation
  • fixed calculation of pairwise tests (no more columns with only zeroes)
  • some refactoring
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/StatisticalTestingView.cs

    r11691 r11692  
    303303
    304304    private void TestAllGroups() {
    305       double pval = KruskalWallis.Test(data);
     305      double pval = KruskalWallisTest.Test(data);
    306306      pValTextBox.Text = pval.ToString();
    307307      if (pval < significanceLevel) {
     
    359359
    360360      double[][] newData = FilterDataForPairwiseTest(colIndex);
    361 
    362       double mwuBothtails;
    363       double mwuLefttail;
    364       double mwuRighttail;
    365361      int cnt = 0;
    366 
    367362      for (int i = 0; i < newData.Length; i++) {
    368         alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, newData[i], newData[i].Length, out mwuBothtails, out mwuLefttail, out mwuRighttail);
     363        double mwuBothtails = PairwiseTest.MannWhitneyUTest(data[colIndex], newData[i]);
    369364        if (mwuBothtails > significanceLevel) {
    370365          cnt++;
     
    435430
    436431      double mwuBothtails;
    437       double mwuLefttail;
    438       double mwuRighttail;
    439432      double tTestBothTails;
    440433      double[] mwuPValues = new double[newData.Length];
     
    445438
    446439      for (int i = 0; i < newData.Length; i++) {
    447         if (i != colIndex) {
    448           alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, newData[i], newData[i].Length, out mwuBothtails,
    449             out mwuLefttail, out mwuRighttail);
    450           tTestBothTails = TTest.Test(data[colIndex], newData[i]);
    451           mwuPValues[i] = mwuBothtails;
    452           tTestPValues[i] = tTestBothTails;
    453         }
     440        mwuBothtails = PairwiseTest.MannWhitneyUTest(data[colIndex], newData[i]);
     441        tTestBothTails = PairwiseTest.TTest(data[colIndex], newData[i]);
     442        mwuPValues[i] = mwuBothtails;
     443        tTestPValues[i] = tTestBothTails;
    454444      }
    455445
     
    458448
    459449      for (int i = 0; i < newData.Length; i++) {
    460         if (i != colIndex) {
    461           pValsMatrix[0, i] = mwuPValues[i];
    462           pValsMatrix[1, i] = adjustedMwuPValues[i];
    463           pValsMatrix[2, i] = tTestPValues[i];
    464           pValsMatrix[3, i] = adjustedTtestPValues[i];
    465           pValsMatrix[4, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], newData[i]);
    466           pValsMatrix[5, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], newData[i]);
    467         }
     450        pValsMatrix[0, i] = mwuPValues[i];
     451        pValsMatrix[1, i] = adjustedMwuPValues[i];
     452        pValsMatrix[2, i] = tTestPValues[i];
     453        pValsMatrix[3, i] = adjustedTtestPValues[i];
     454        pValsMatrix[4, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], newData[i]);
     455        pValsMatrix[5, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], newData[i]);
    468456      }
    469457
Note: See TracChangeset for help on using the changeset viewer.