Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/21/13 13:26:16 (12 years ago)
Author:
ascheibe
Message:

#1886 calculate Cohen's D and Hedges' G for pairwise comparison and updated documentation

Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3
Files:
3 edited

Legend:

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

    r9328 r9329  
    4949    /// <returns>Cohen's d.
    5050    /// d = 0.2 means small effect
    51     /// d = 0.5 means average effect
     51    /// d = 0.5 means medium effect
    5252    /// d = 0.8 means big effect
    5353    /// According to Wikipedia this means: "A lower Cohen's d indicates a necessity of larger sample sizes, and vice versa."
    5454    /// </returns>
    55     public static double CohensD(double[] d1, double[] d2) {
     55    public static double CalculateCohensD(double[] d1, double[] d2) {
    5656      double x1, x2, s1, s2;
    5757
     
    6565
    6666    /// <summary>
    67     /// Calculates Hedges' g.
     67    /// Calculates Hedges' g.
     68    /// Hedges' g works like Cohen's d but corrects for bias.
    6869    /// </summary>
    6970    /// <returns>Hedges' g</returns>
    70     public static double HedgesG(double[] d1, double[] d2) {
     71    public static double CalculateHedgesG(double[] d1, double[] d2) {
    7172      double x1, x2, s1, s2, n1, n2, s, g, c;
    7273
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/StatisticalTestingView.cs

    r9320 r9329  
    2626using System.Windows.Forms;
    2727using HeuristicLab.Analysis.AlgorithmBehavior.Analyzers;
     28using HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views;
    2829using HeuristicLab.Core.Views;
    2930using HeuristicLab.Data;
     
    206207      DoubleMatrix pValsMatrix = new DoubleMatrix(1, stringConvertibleMatrixView.Content.Columns);
    207208      pValsMatrix.ColumnNames = stringConvertibleMatrixView.Content.ColumnNames;
    208       pValsMatrix.RowNames = new string[] { "p-Values" };
     209      pValsMatrix.RowNames = new string[] { "p-Value" };
    209210
    210211      double val;
     
    232233      }
    233234
    234       DoubleMatrix pValsMatrix = new DoubleMatrix(1, stringConvertibleMatrixView.Content.Columns);
     235      DoubleMatrix pValsMatrix = new DoubleMatrix(3, stringConvertibleMatrixView.Content.Columns);
    235236      pValsMatrix.ColumnNames = stringConvertibleMatrixView.Content.ColumnNames;
    236       pValsMatrix.RowNames = new string[] { "p-Values" };
     237      pValsMatrix.RowNames = new string[] { "p-Value", "Cohen's d", "Hedges' g" };
    237238
    238239      double bothtails;
     
    242243        alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, data[i], data[i].Length, out bothtails, out lefttail, out righttail);
    243244        pValsMatrix[0, i] = bothtails;
     245        pValsMatrix[1, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], data[i]);
     246        pValsMatrix[2, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], data[i]);
    244247      }
    245248
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/StatisticalTestingView.resx

    r9320 r9329  
    166166        lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
    167167        f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
    168         j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDwAACw8BkvkDpQAAABl0RVh0U29mdHdhcmUA
     168        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDgAACw4BQL7hQQAAABl0RVh0U29mdHdhcmUA
    169169        UGFpbnQuTkVUIHYzLjUuODc7gF0AAAK0SURBVDhPrZBrSNNRAMWNvkVEEBT0oY+BUAgSRBhIQmUqKYb4
    170170        KgudU1MTlj2WZUlMykdu+VhatmWKWaaITF35qCmzWoaGj81kms72dm5/3cM9TtvdX9Sob/0+XC6Hcw73
     
    194194
    195195For pairwise comparision of the groups the Mann-Whitney U test is used.
    196 It also requires sample sizes of at least 5 samples.</value>
     196It also requires sample sizes of at least 5 samples.
     197
     198The p-values calculated by the statistical tests are interpreted as follows:
     199The null hypothesis states that the groups which are compared have the same distribution.
     200A p-value &lt; 0.05 (this value is often chosen as significance level)  means the null hypothesis is rejected,
     201which therefore means that the distributions are not equal.
     202
     203For the pariwise statistical test, in addition to the p-value, Cohen's d and Hedges' g are calculated.
     204According to Wikipedia, these values can be interpreted as follows: "A lower Cohen's d indicates a necessity of larger sample sizes, and vice versa."</value>
    197205  </data>
    198206</root>
Note: See TracChangeset for help on using the changeset viewer.