Changeset 9950 for branches/StatisticalTesting
- Timestamp:
- 09/12/13 14:21:06 (11 years ago)
- Location:
- branches/StatisticalTesting
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/HeuristicLab.Analysis.Statistics-3.3.csproj
r9937 r9950 119 119 </ItemGroup> 120 120 <ItemGroup> 121 <Compile Include="BonferroniHolm.cs" /> 121 122 <Compile Include="ExpFitting.cs" /> 122 123 <Compile Include="IFitting.cs" /> -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/StatisticalTestingView.cs
r9937 r9950 36 36 [Content(typeof(RunCollection), false)] 37 37 public sealed partial class StatisticalTestingView : ItemView { 38 private const double significanceLevel = 0.05; 38 39 private double[][] data; 39 40 … … 297 298 double pval = KruskalWallis.Test(data); 298 299 pValTextBox.Text = pval.ToString(); 299 if (pval < 0.05) {300 if (pval < significanceLevel) { 300 301 this.Invoke(new Action(() => { groupCompLabel.Image = HeuristicLab.Analysis.Statistics.Resources.Default; })); 301 302 } else { … … 314 315 315 316 // p-value is below significance level and thus the null hypothesis (data is normally distributed) is rejected. 316 if (res.Any(x => x < 0.05)) {317 if (res.Any(x => x < significanceLevel)) { 317 318 this.Invoke(new Action(() => { normalityLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Warning; })); 318 319 } else { … … 355 356 if (i != colIndex) { 356 357 alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, data[i], data[i].Length, out mwuBothtails, out mwuLefttail, out mwuRighttail); 357 if (mwuBothtails > 0.05) {358 if (mwuBothtails > significanceLevel) { 358 359 cnt++; 359 360 } … … 383 384 } 384 385 385 DoubleMatrix pValsMatrix = new DoubleMatrix(5, stringConvertibleMatrixView.Content.Columns); 386 var rowNames = new string[] { "p-Value of Mann-Whitney U", "Adjusted p-Value of Mann-Whitney U", 387 "p-Value of T-Test", "Adjusted p-Value of T-Test", "Necessary Sample Size for T-Test", "Cohen's d", "Hedges' g" }; 388 389 DoubleMatrix pValsMatrix = new DoubleMatrix(rowNames.Length, stringConvertibleMatrixView.Content.Columns); 386 390 pValsMatrix.ColumnNames = stringConvertibleMatrixView.Content.ColumnNames; 387 pValsMatrix.RowNames = new string[] { "p-Value of Mann-Whitney U", "p-Value of T-Test", "Necessary Sample Size for T-Test", "Cohen's d", "Hedges' g" };391 pValsMatrix.RowNames = rowNames; 388 392 389 393 double mwuBothtails; 390 394 double mwuLefttail; 391 395 double mwuRighttail; 392 double ttestLefttail; 396 double tTestLefttail; 397 double[] mwuPValues = new double[data.Length]; 398 double[] tTestPValues = new double[data.Length]; 399 bool[] decision = null; 400 double[] adjustedMwuPValues = null; 401 double[] adjustedTtestPValues = null; 402 393 403 for (int i = 0; i < data.Length; i++) { 394 404 alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, data[i], data[i].Length, out mwuBothtails, out mwuLefttail, out mwuRighttail); 395 ttestLefttail = TTest.Test(data[colIndex], data[i]); 396 pValsMatrix[0, i] = mwuBothtails; 397 pValsMatrix[1, i] = ttestLefttail; 398 pValsMatrix[2, i] = TTest.GetOptimalSampleSize(data[colIndex], data[i]); 399 pValsMatrix[3, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], data[i]); 400 pValsMatrix[4, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], data[i]); 405 tTestLefttail = TTest.Test(data[colIndex], data[i]); 406 mwuPValues[i] = mwuBothtails; 407 tTestPValues[i] = tTestLefttail; 408 } 409 410 adjustedMwuPValues = BonferroniHolm.Calculate(significanceLevel, mwuPValues, out decision); 411 adjustedTtestPValues = BonferroniHolm.Calculate(significanceLevel, tTestPValues, out decision); 412 413 for (int i = 0; i < data.Length; i++) { 414 pValsMatrix[0, i] = mwuPValues[i]; 415 pValsMatrix[1, i] = adjustedMwuPValues[i]; 416 pValsMatrix[2, i] = tTestPValues[i]; 417 pValsMatrix[3, i] = adjustedTtestPValues[i]; 418 pValsMatrix[4, i] = TTest.GetOptimalSampleSize(data[colIndex], data[i]); 419 pValsMatrix[5, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], data[i]); 420 pValsMatrix[6, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], data[i]); 401 421 } 402 422 -
branches/StatisticalTesting/Statistics.UnitTests/Statistics.UnitTests.csproj
r9721 r9950 64 64 <Compile Include="KruskalWallisUnitTests.cs" /> 65 65 <Compile Include="Properties\AssemblyInfo.cs" /> 66 <Compile Include="BonferroniHolmUnitTest.cs" /> 66 67 </ItemGroup> 67 68 <ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.