Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/28/13 10:08:37 (11 years ago)
Author:
ascheibe
Message:

#1886 added ttest and sample size determination for the ttest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/StatisticalTestingView.cs

    r9333 r9336  
    234234      }
    235235
    236       DoubleMatrix pValsMatrix = new DoubleMatrix(3, stringConvertibleMatrixView.Content.Columns);
     236      DoubleMatrix pValsMatrix = new DoubleMatrix(5, stringConvertibleMatrixView.Content.Columns);
    237237      pValsMatrix.ColumnNames = stringConvertibleMatrixView.Content.ColumnNames;
    238       pValsMatrix.RowNames = new string[] { "p-Value", "Cohen's d", "Hedges' g" };
    239 
    240       double bothtails;
    241       double lefttail;
    242       double righttail;
     238      pValsMatrix.RowNames = new string[] { "p-Value of MannWhitneyU", "p-Value of T-Test", "Necessary Sample Size for T-Test", "Cohen's d", "Hedges' g" };
     239
     240      double mwuBothtails;
     241      double mwuLefttail;
     242      double mwuRighttail;
     243      double ttestLefttail;
    243244      for (int i = 0; i < data.Length; i++) {
    244         alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, data[i], data[i].Length, out bothtails, out lefttail, out righttail);
    245         pValsMatrix[0, i] = bothtails;
    246         pValsMatrix[1, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], data[i]);
    247         pValsMatrix[2, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], data[i]);
     245        alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, data[i], data[i].Length, out mwuBothtails, out mwuLefttail, out mwuRighttail);
     246        ttestLefttail = TTest.Test(data[colIndex], data[i]);
     247        pValsMatrix[0, i] = mwuBothtails;
     248        pValsMatrix[1, i] = ttestLefttail;
     249        pValsMatrix[2, i] = TTest.GetOptimalSampleSize(data[colIndex], data[i]);
     250        pValsMatrix[3, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], data[i]);
     251        pValsMatrix[4, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], data[i]);
    248252      }
    249253
Note: See TracChangeset for help on using the changeset viewer.