- Timestamp:
- 09/13/13 12:24:04 (11 years ago)
- Location:
- branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/StatisticalTestingView.cs
r9950 r9957 348 348 } 349 349 350 double[][] newData = FilterDataForPairwiseTest(colIndex); 351 350 352 double mwuBothtails; 351 353 double mwuLefttail; … … 353 355 int cnt = 0; 354 356 355 for (int i = 0; i < data.Length; i++) { 356 if (i != colIndex) { 357 alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, data[i], data[i].Length, out mwuBothtails, out mwuLefttail, out mwuRighttail); 358 if (mwuBothtails > significanceLevel) { 359 cnt++; 360 } 357 for (int i = 0; i < newData.Length; i++) { 358 alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, newData[i], newData[i].Length, out mwuBothtails, out mwuLefttail, out mwuRighttail); 359 if (mwuBothtails > significanceLevel) { 360 cnt++; 361 361 } 362 362 } … … 372 372 } 373 373 374 private double[][] FilterDataForPairwiseTest(int columnToRemove) { 375 double[][] newData = new double[data.Length - 1][]; 376 377 int i = 0; 378 int l = 0; 379 while (i < data.Length) { 380 if (i != columnToRemove) { 381 double[] row = new double[data[i].Length - 1]; 382 newData[l] = row; 383 384 int j = 0, k = 0; 385 while (j < row.Length) { 386 if (i != columnToRemove) { 387 newData[l][j] = data[i][k]; 388 j++; 389 k++; 390 } else { 391 k++; 392 } 393 } 394 i++; 395 l++; 396 } else { 397 i++; 398 } 399 } 400 return newData; 401 } 402 374 403 private void CalculatePairwiseTestDetails(string groupName) { 375 404 int colIndex = 0; … … 384 413 } 385 414 415 double[][] newData = FilterDataForPairwiseTest(colIndex); 416 417 columnNames = columnNames.Where(x => x != groupName).ToList(); 418 386 419 var rowNames = new string[] { "p-Value of Mann-Whitney U", "Adjusted p-Value of Mann-Whitney U", 387 420 "p-Value of T-Test", "Adjusted p-Value of T-Test", "Necessary Sample Size for T-Test", "Cohen's d", "Hedges' g" }; 388 421 389 DoubleMatrix pValsMatrix = new DoubleMatrix(rowNames.Length, stringConvertibleMatrixView.Content.Columns);390 pValsMatrix.ColumnNames = stringConvertibleMatrixView.Content.ColumnNames;422 DoubleMatrix pValsMatrix = new DoubleMatrix(rowNames.Length, columnNames.Count()); 423 pValsMatrix.ColumnNames = columnNames; 391 424 pValsMatrix.RowNames = rowNames; 392 425 … … 395 428 double mwuRighttail; 396 429 double tTestLefttail; 397 double[] mwuPValues = new double[ data.Length];398 double[] tTestPValues = new double[ data.Length];430 double[] mwuPValues = new double[newData.Length]; 431 double[] tTestPValues = new double[newData.Length]; 399 432 bool[] decision = null; 400 433 double[] adjustedMwuPValues = null; 401 434 double[] adjustedTtestPValues = null; 402 435 403 for (int i = 0; i < data.Length; i++) { 404 alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, data[i], data[i].Length, out mwuBothtails, out mwuLefttail, out mwuRighttail); 405 tTestLefttail = TTest.Test(data[colIndex], data[i]); 406 mwuPValues[i] = mwuBothtails; 407 tTestPValues[i] = tTestLefttail; 436 for (int i = 0; i < newData.Length; i++) { 437 if (i != colIndex) { 438 alglib.mannwhitneyutest(data[colIndex], data[colIndex].Length, newData[i], newData[i].Length, out mwuBothtails, 439 out mwuLefttail, out mwuRighttail); 440 tTestLefttail = TTest.Test(data[colIndex], newData[i]); 441 mwuPValues[i] = mwuBothtails; 442 tTestPValues[i] = tTestLefttail; 443 } 408 444 } 409 445 … … 411 447 adjustedTtestPValues = BonferroniHolm.Calculate(significanceLevel, tTestPValues, out decision); 412 448 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]); 449 for (int i = 0; i < newData.Length; i++) { 450 if (i != colIndex) { 451 pValsMatrix[0, i] = mwuPValues[i]; 452 pValsMatrix[1, i] = adjustedMwuPValues[i]; 453 pValsMatrix[2, i] = tTestPValues[i]; 454 pValsMatrix[3, i] = adjustedTtestPValues[i]; 455 pValsMatrix[4, i] = TTest.GetOptimalSampleSize(data[colIndex], newData[i]); 456 pValsMatrix[5, i] = SampleSizeDetermination.CalculateCohensD(data[colIndex], newData[i]); 457 pValsMatrix[6, i] = SampleSizeDetermination.CalculateHedgesG(data[colIndex], newData[i]); 458 } 421 459 } 422 460 -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/StatisticalTestingView.designer.cs
r9937 r9957 339 339 this.allGroupTestGroupBox.TabIndex = 21; 340 340 this.allGroupTestGroupBox.TabStop = false; 341 this.allGroupTestGroupBox.Text = "3. Equal Distributions Check using all Groups";341 this.allGroupTestGroupBox.Text = "3. Kruskal Wallis Test for Inequalities in Distributions"; 342 342 // 343 343 // groupCompLabel … … 365 365 this.normalityGroupBox.TabIndex = 20; 366 366 this.normalityGroupBox.TabStop = false; 367 this.normalityGroupBox.Text = "2. Normal Distribution Check";367 this.normalityGroupBox.Text = "2. Jarque-Bera Test for Normal Distribution"; 368 368 // 369 369 // label4
Note: See TracChangeset
for help on using the changeset viewer.