Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a project I did some time back in an intro c++ class.
- #include <iostream>
- #include <string>
- #include <time.h>
- #include <conio.h>
- #include <math.h>
- #include <fstream>
- #include <cstdlib>
- #include <sstream>
- using namespace std;
- /* Statistics Calculator project.
- A basic statistics calculator.
- The initial possibilities for this program were:
- Do a Corrolation Coefficent (Pearson r) between two arrays. Output the r and the
- sub results used to get it.
- t-test
- Do a 2 way analysis of variance (ANOVA)
- Z ratio.
- To assure accuracy, data from an actual statistics class will be used to test the
- calculations. As long as the answers match the class data, the calculator should
- be doing the proper job.
- Actual abilities of the program turned out to be less than the initial goal. In
- short, doing more than a few tests is not practical unless you are writing an in
- depth program. As a result, a smaller, more closely related set of tests was
- chosen. This allows for a more limited range of data to be taken in and dealt
- with. It also allows for the project to be finished before the semester is over!
- I officially HATE misprints. Due to a misprint in Statistics Unplugged, I spent
- hours trying to debug my standard deviation formula, when the computer was right
- and the book was wrong.
- Data for tables from:
- Caldwell, Sally. Statistics Unplugged. 3rd. Belmont, CA: Wadsworth Cengage Learning, 2010. Print.
- and
- StatSoft, Inc. Electronic Statistics Textbook, Tulsa, OK: StatSoft, Inc., 2011. Web.
- Mock values and testing data from:
- MATH/PSYCH 108: Statistics, Summer 2011, Dr. Pfahler.
- */
- void pause()
- {cout << "\nPress any key.\n"; _getch();}
- int inVal(int); // Takes maximum # menu items, returns # or outputs "1 for Help" message.
- typedef long double* LDPtr;
- struct modeArr{
- int count;
- long double value;
- };
- void psudoStats(long double arr[], int);
- long double findMean(long double arr[], int);
- long double findMedian(long double arr[], int);
- int findMode(long double arr[], int, modeArr mode[]);
- void exchangeSort(long double arr[], int);
- float findStdDev (long double arr[], int);
- void printStats(long double arr[], int numStats);
- void seedStats(long double arr0[], int&, long double arr1[], int&);
- float zScore(float sD, long double mean, long double rZS);
- long double longDubIn();
- float floatIn(float range);
- float zRatio(float zS);
- void zRatio2Raw(float sD, long double mean, float zR);
- float zRatio2Score(float zR);
- float corrAnalysis(long double arr0[], long double arr1[], int&);
- void corrSignificance(float pR, int&);
- bool loadStatsFile(long double arr[], int&, string);
- int main()
- {
- void printMenu(int numStatsArr[]), printHelp();
- int menuChoice = 0, subChoice = 0, numStats, numModes, wA, whichArr();
- char yN;
- system ("color 17");
- long double mean = -1234567.890987, rS = -1234567.890987;
- float sD, pR, zS, zR;
- bool success = false;
- string fileName = "stats.txt";
- cout.setf(ios::fixed);
- cout.setf(ios::showpoint);
- cout.precision(2);
- int maxStats = 500;
- // 1 2 3 4 5 6 7 8
- //12345678901234567890123456789012345678901234567890123456789012345678901234567890
- cout << "This is a very basic statistics calculator. It takes in values as floating\n"
- << "point numbers and performs a small range of basic options on them.\n\n"
- << "The largest number of samples to work with is defaulted at " << maxStats << ". At this time,\n"
- << "you may change this number. However, you may not change it later.\n\n"
- << "Would you like to change the maximum number of samples to work with? (y/n) ";
- cin >> yN;
- if (yN == 'y' || yN == 'Y')
- {
- cout << "What is the new maximum? ";
- cin >> maxStats;
- }
- cout << endl;
- long double * statsArrPtr[2];
- LDPtr statsArr1;
- statsArr1 = new long double[maxStats];
- statsArrPtr[0] = statsArr1;
- LDPtr statsArr2;
- statsArr2 = new long double[maxStats];
- statsArrPtr[1] = statsArr2;
- modeArr * mode;
- mode = new modeArr[maxStats];
- int numStatsArr[2] = {0,0} ;//= {numStats1, numStats2};
- printHelp();
- printMenu(numStatsArr);
- do
- {
- menuChoice = inVal(9);
- switch(menuChoice)
- {
- case 0:
- cout << "Thank you for using this program. I hope it helped.\n\n"
- << "Tablular data for calculations, mock values, and testing data from:\n\n"
- << "\tCaldwell, Sally. Statistics Unplugged. 3rd. Belmont, CA,\n"
- << " Wadsworth Cengage Learning, 2010. Print.\n\n"
- << "\tStatSoft, Inc. Electronic Statistics Textbook, Tulsa, OK,\n"
- << " StatSoft, Inc., 2011. Web.\n\n"
- << "\tPfahler, Dr. Diane. MATH/PSYCH 108: Statistics, Yucaipa, CA,\n"
- << " Crafton Hills College, 2011. Lecture.\n\n";
- break;
- case 1:
- printHelp();
- pause();
- printMenu(numStatsArr);
- cout << "\nRetuning to main menu.\n";
- break;
- case 2:
- subChoice = 1;
- do {
- switch (subChoice)
- {
- case 1:
- cout << "Input, Load, or Generate Data \n"
- // 1 2 3 4 5 6 7 8
- // 12345678901234567890123456789012345678901234567890123456789012345678901234567890
- << "From this menu you can pick from pre-made test data, load data from a file, \n"
- << "or generate fake test data.\n\n"
- << "Data that is loaded must be in a text file, one item per line. If it will be\n"
- << "used in a Correlation Analysis (Pearson's r,) the fist data set will be one \n"
- << "value and the second data set will be the other. Also, r requires that both \n"
- << "files have the same number of lines.\n\n"
- << "The pre-made test data is from a statistics class and gives verified results.\n\n"
- << "Generated test data uses a normal distribution.\n\n";
- break;
- case 2:
- cout << "This overwites an array with \"normal\" data from -100 to +100 with a\n"
- << "distribution that follows a normal curve. While normalized in shape, the\n"
- << "data is otherwise very random and unsorted. \n"
- << "NOTE: This is NOT a good way to test the Correlation Analysis.\n"
- << "Continue? (y/n) ";
- cin >> yN;
- if (yN == 'y' || yN == 'Y')
- {
- wA = whichArr();
- while ((cout << "How many psudostats? ") && (!(cin >> numStats) || numStats < 1 || numStats > maxStats))
- {
- cout << "That is not a valid entry. It must be postitive and less than " << maxStats << ".";
- cin.clear();
- cin.ignore(numeric_limits<streamsize>::max(), '\n');
- }
- numStatsArr[wA] = numStats;
- psudoStats(statsArrPtr[wA], numStatsArr[wA]);
- }
- break;
- case 3:
- cout << "Copy one data set to the other.\n"
- << "You select the source array and it overwrites the other.\n";
- wA = whichArr();
- if (wA)
- {
- for (int i=0; i < numStatsArr[1];i++)
- {
- statsArr1[i] = statsArr2[i];
- }
- numStatsArr[0] = numStatsArr[1];
- }
- else
- {
- for (int i=0; i < numStatsArr[0];i++)
- {
- statsArr2[i] = statsArr1[i];
- }
- numStatsArr[1] = numStatsArr[0];
- }
- break;
- case 4:
- wA = whichArr();
- cout << "Sorting.\n";
- exchangeSort(statsArrPtr[wA], numStatsArr[wA]);
- cout << "Finished.\n";
- cout << "Returning to Input, Load, or Generate Data.\n";
- break;
- case 5:
- cout << "The pre-made test data comes in a few flavors to allow different operations.\n"
- << "The small data sets require up to a maximum of 30 stats be enterable.\n\n";
- if (maxStats < 30) cout << "The maximum number of stats, " << maxStats << " is too low for this.";
- else
- {
- cout << "At least one data set will be be overwritten. Continue? (y/n) ";
- cin >> yN;
- if (yN == 'y' || yN == 'Y')
- {
- seedStats(statsArrPtr[0], numStatsArr[0], statsArrPtr[1], numStatsArr[1]);
- }
- }
- break;
- case 6:
- // 1 2 3 4 5 6 7 8
- // 12345678901234567890123456789012345678901234567890123456789012345678901234567890
- cout << "This program reads in statistics as a one item per line file. It will not \n"
- << "know what to do with non-numeric data, multiple items per line, or any other \n"
- << "issue. Also, if you need to load paired data for a Correlation Analysis, load \n"
- << "the first item into the first statistics array and the second item into the \n"
- << "other. It can take in positives or negatives up to the maximum samples limit.\n\n"
- << "WARNING: Blank lines load as zeros! \n\n"
- << "Would you like to load a file into one of the statistics arrays? ";
- cin >> yN;
- if (yN == 'y' || yN == 'Y')
- {
- cout << "\nThe corrent file name that will be loaded is:\n"
- << "\t" << fileName << endl
- << "Would you like to change the file that would be loaded? (y/n) ";
- cin >> yN;
- if (yN == 'y' || yN == 'Y')
- {
- cout << "New filename: ";
- cin.sync();
- getline(cin, fileName, '\n');
- cin.clear();
- }
- cout << "\nWhich set of starts to load into?\n";
- wA = whichArr();
- success = loadStatsFile(statsArrPtr[wA], numStatsArr[wA], fileName.c_str());
- if (success == false)
- {
- cout << "Can not find: " << fileName << "\nReturning to Input, Load, or Generate Data\n\n";
- break;
- }
- else cout << "File loaded into array " << (wA+1) << ".\n\n";
- }
- break;
- }
- cout << "\t0: Exit back to the main menu.\n"
- << "\t1: Instructions.\n"
- << "\t2: Generate Psudostats.\n"
- << "\t3: Copy one data set to the other.\n"
- << "\t4: Sort a data set.\n"
- << "\t5: Use pre-made test data.\n"
- << "\t6: Load from a file.\n"
- << "\tSelection: ";
- subChoice = inVal(6);
- } while (subChoice);
- cout << "\nRetuning to main menu.\n";
- printMenu(numStatsArr);
- break;
- case 3:
- cout << "Dumping stats.\n\n";
- wA = whichArr();
- printStats(statsArrPtr[wA], numStatsArr[wA]);
- cout << "\nRetuning to main menu.\n";
- break;
- case 4:
- wA = whichArr();
- numModes = findMode(statsArrPtr[wA], numStatsArr[wA], mode);
- cout << "Finding Measures of Central Tendency\n"
- << "\tMean: " << findMean(statsArrPtr[wA], numStatsArr[wA]) << endl
- << "\tMedian: " << findMedian(statsArrPtr[wA], numStatsArr[wA]) << endl
- << "\tMode: ";
- for (int i = 0; i < numModes; i++)
- if (mode[0].count == mode[i].count) cout << mode[i].value << ", ";
- cout << "\b\b (" << mode[0].count << ")\n";
- cout << "Standard Deveation is: " << findStdDev(statsArrPtr[wA], numStatsArr[wA]) << endl;
- cout << "\nRetuning to main menu.\n";
- break;
- case 5:
- subChoice = 1;
- do {
- switch (subChoice)
- {
- case 1:
- cout << "Z Ratio Caclulations. \n"
- // 1 2 3 4 5 6 7 8
- // 12345678901234567890123456789012345678901234567890123456789012345678901234567890
- << " This requires a raw score, standard deviation (SD), and mean. It does\n"
- << " operations that relate to the ratio of the raw score to the mean in SD \n"
- << " units, AKA: the Z Score. A Z < 1 and > -1 is normal and represents roughly\n"
- << " 68% of the population. If a Z score is outside that range, it is\n"
- << " significant. 1 < |Z| < 2 is above/below average and has roughly 27% of\n"
- << " the population, 2 < |Z| < 3 is very above/below at about 4%, and |Z| > 3\n"
- << " is exceptionally rare at about 1%. Because this is both above and below, an\n"
- << " SD 3+ is actualy less than half a percent of the population.\n"
- << endl
- << " With this Z Ratio Caclulator, you can turn data into SD, see where it \n"
- << " falls in relation to other data, and perform other Z based operations.\n\n"
- << " The some data is always input. The SD and mean may be input or calculated.\n"
- << " Z Ratio operations are available after SD and mean data are set.\n\n";
- break;
- case 2:
- wA = whichArr();
- mean = findMean(statsArrPtr[wA], numStatsArr[wA]);
- sD = findStdDev(statsArrPtr[wA], numStatsArr[wA]);
- break;
- case 3:
- cout << "What SD would you like to use?\n";
- sD = floatIn(99999.9);
- cout << "What mean would you like to use?\n";
- mean = longDubIn();
- break;
- case 4:
- cout << "What raw score would you like to evaluate?\n";
- rS = longDubIn();
- case 5:
- if (rS == -1234567.890987)
- {
- cout << "What raw score would you like to evaluate?\n";
- rS = longDubIn();
- }
- zS = zScore(sD, mean, rS);
- zR = zRatio(zS);
- cout << "The raw score " << rS << " is " << " Z = " << zS << endl
- << "from the mean of " << mean << " when the standard deviation is " << sD << ".\n"
- << "The percentage of the scores are between " << rS << " and " << mean << " is " << (zR * 100) << "%.\n\n";
- break;
- case 6:
- cout << "What Z Ratio from -50.00 to 50.00 would you like to evaluate?\n"
- << "This represents 100%, with 50% (the mean) being 0.\n\n";
- zR = floatIn(50.00);
- zRatio2Raw(sD, mean, (zR/100.0));
- break;
- }
- cout << "\t0: Exit back to the main menu.\n"
- << "\t1: Show Z Ratio instructions again.\n"
- << "\t2: Calculate SD and mean from stats that have already been loaded.\n"
- << "\t3: Manually enter SD and mean.\n";
- if (mean != -1234567.890987)
- {
- cout << "\t4: Change raw score and perform Z Ratio Caclulation.\n"
- << "\t5: Perform Z Ratio Caclulation.\n"
- << "\t6: Convert a Z Ratio percentage into a SD and raw score.\n";
- subChoice = inVal(6);
- }
- else
- {
- cout << "\tSelection: ";
- subChoice = inVal(3);
- }
- } while (subChoice);
- cout << "\nRetuning to main menu.\n";
- break;
- case 6:
- subChoice = 1;
- do {
- switch (subChoice)
- {
- case 1:
- cout << "Correlation Analysis, AKA: Pearson's r.\n"
- // 1 2 3 4 5 6 7 8
- // 12345678901234567890123456789012345678901234567890123456789012345678901234567890
- << " This requires both data sets be filled with the same number of entries. \n"
- << " The term Correlation Analysis is very literal. It evaluates (analyzes) the\n"
- << " relationship (correlation) between two values on a set of subjects. In \n"
- << " this program, the number of samples is the number of subjects. The \n"
- << " statistics sets 1 and 2 will each represent one of the two values, which\n"
- << " is why they must have the same number of entries.\n\n"
- << " DO NOT SORT THE DATA! \n"
- << " If you sort, the relationships will be lost.\n\n";
- break;
- case 2:
- cout << "The results are given in the form r = {-1 to 1}. If r = 0, there is no\n"
- << "relationship. If r is 1, a perfect positive relationship exists and as value\n"
- << "1 goes up, value 2 goes up an equal ratio. If r = -1, this is a perfect\n"
- << "inverse relationship where as one goes up the other goes down. All other\n"
- << "values represent a less strong relationship, which is normal.\n\n"
- << "The rule of thumb for results is, an |r| of:\n"
- << " .0 to .2 means no to very little relationship,\n"
- << " .2 to .4 means a weak relationship,\n"
- << " .4 to .6 means a moderate relationship,\n"
- << " .6 to .6 means a strong relationship, and\n"
- << " .8 to 1.0 means a very strong to perfect relationship.\n\n"
- << "There is also the question of if your results are mainingful. ";
- pause();
- cout << "\nWhen a Correlation Analysis is performed, how accurate it is depends on\n"
- << "something called the Critical Values, which relates to the Degrees of\n"
- << "Freedom. The Degrees of Freedom is very simple, the number of samples - 2.\n"
- << "However, using it requires a table. Here are some sample results:\n\n"
- << "With 5 samples and an r = .4, a weak to moderate relationship seems possible,\n"
- << "but the results would be discarded because 5 samples is 3 DF, which requires \n"
- << "r = .404 to be acceptable 50% of the time, or r = .8054 for 90% of the time. \n"
- << "In contrast, with 50 samples an r of .2353 is significant 90% of the time.\n\n"
- << "This program will output the level of significance in a wide range.\n"
- << "However, only 90% or better is acceptable for real studies. Lower\n"
- << "percentages generally mean you need to refine your study. Also, the DF\n"
- << "table used sees all DF > 100 as 100, but that is still valid.\n\n";
- break;
- case 3:
- pR = corrAnalysis(statsArrPtr[0], statsArrPtr[1], numStatsArr[0]);
- cout << "The correlation results are r = " << pR << "\n\n";
- corrSignificance(pR, numStatsArr[0]);
- break;
- }
- cout << "\t0: Exit back to the main menu.\n"
- << "\t1: Show Correlation Analysis instructions again.\n"
- << "\t2: Interpreting results.\n";
- if (numStatsArr[0] != numStatsArr[1])
- {
- cout << "\nThe number of stats in the samples do not match. You must exit "
- << "to the main menu and fix this before continuing.\n";
- subChoice = inVal(2);
- }
- else
- {
- cout << "\t3: Perform a Correlation Analysis on the data.\n";
- subChoice = inVal(3);
- }
- } while (subChoice);
- cout << "\nRetuning to main menu.\n";
- break;
- default:
- printMenu(numStatsArr);
- }
- }while(menuChoice);
- pause();
- return(0);
- }// main()
- void printMenu(int numStatsArr[])
- {
- cout << "\nPick an option:\n"
- << "\t0: Exit.\n"
- << "\t1: Help.\n\n"
- << "\t2: Load, generate, or manipulate data.\n\n";
- if (numStatsArr[0] == 0 && numStatsArr[1] == 0) cout << "Data must exist before you can see other options.";
- else
- {
- cout << "\t3: Dump data to screen.\n"
- << "\t4: Measures of Central Tendency.\n"
- << "\t5: Z Ratio Operations.\n"
- << "\t6: Correlation Analysis (r).\n\n"
- << "\t9: Show this menu again.\n";
- }
- } // end printMenu()
- void printHelp()
- {
- // 1 2 3 4 5 6 7 8
- //12345678901234567890123456789012345678901234567890123456789012345678901234567890
- cout << "The followng operations may be performed with this program:\n"
- << endl
- << "Load, generate, or manipulate data: Take in data from a file, use pre-made \n"
- << " data, use a normal curve generator, and then do basic manipulations like \n"
- << " sorting or adding significance.\n"
- << "Dump data to screen: Basic screen output of raw data.\n"
- << "Measures of Central Tendency: Sorted data is converted into the mean (average),\n"
- << " median (center most value), and mode (most frequent value).\n"
- << "Z Ratio Operations: Z is a statistical comparison based on standard deviation\n"
- << " from the mode. This allows a few basic operations related to Z.\n"
- << "Correlation Analysis AKA: Pearson's r: A measure of two values to see if when\n"
- << " the first (independent) value goes up or down, the second (dependent) \n"
- << " value also goes up or down, does the opposite, or is not related.\n\n";
- }// end printHelp()
- void printStats(long double arr[], int numStats)
- {
- int wrap=0;
- for(int i = 0; i < numStats; i++)
- {
- cout << arr[i] << " ";
- if (arr[i] > 99999.99 || arr[i] < -9999.99) wrap += 10;
- else if (arr[i] > 9999.99 || arr[i] < -999.99) wrap += 9;
- else if (arr[i] > 999.99 || arr[i] < -99.99) wrap += 8;
- else if (arr[i] > 99.99 || arr[i] < -9.99) wrap += 7;
- else if (arr[i] > 9.99 || arr[i] < -.99) wrap += 6;
- else if (arr[i] > .99 || arr[i] < -.09) wrap += 5;
- else wrap += 4;
- if (wrap > 70)
- {
- wrap = 0;
- cout << endl;
- }
- }
- cout << endl;
- }
- int inVal(int y)
- {
- int x;
- while ((cout << "\nMenu Selection: ") &&
- (!(cin >> x) || x < 0 || x > y))
- {
- cout << "That is not a valid entry. Try again or 1 for help. ";
- cin.clear();
- cin.ignore(numeric_limits<streamsize>::max(), '\n');
- }
- cout << endl;
- return x;
- } // end inVal(int y)
- void psudoStats(long double arr[], int x)
- {
- int sd3, sd2, sd1, i, j;
- srand (time(NULL));
- sd3 = x / 5;
- sd2 = x / 27;
- sd1 = x - sd2 - sd3;
- for (i = 0; i < x; i++)
- {
- for (j = 0; j < sd3; j++)
- {
- arr[i] = static_cast<long double>(9500.0 + (rand() % 500));
- if (i % 2) arr[i] *= -1.0;
- }
- for (j = 0; j < sd2; j++)
- {
- arr[i] = static_cast<long double>(6800.0 + (rand() % 2700));
- if (i % 2) arr[i] *= -1.0;
- }
- for (j = 0; j < sd1; j++)
- {
- arr[i] = static_cast<long double>((rand() % 6800));
- if (i % 2) arr[i] *= -1.0;
- }
- arr[i] /= 100.0;
- }
- }// end psudoStats
- long double findMedian(long double arr[], int numStats)
- {
- int i;
- if (numStats % 2 == 1)
- {
- i = (numStats / 2);
- return (arr[i]);
- }
- else
- {
- i = numStats / 2;
- return ((arr[i] + arr[i-1])/2);
- }
- }// end findMedian
- long double findMean(long double arr[], int numStats)
- {
- long double x = 0.0;
- for (int i = 0; i < numStats; i++)
- x += arr[i];
- return (x/numStats);
- }// end findMean
- void exchangeSort(long double arr[], int numStats)
- {
- int i, j;
- long double temp;
- for (i=0; i< (numStats -1); i++)
- {
- for(j = (i+1); j < numStats; j++)
- {
- if (arr[i] > arr[j])
- {
- temp = arr[i];
- arr[i] = arr[j];
- arr[j] = temp;
- }
- }
- if (i % 4 == 0) cout << "\b\\";
- if (i % 4 == 1) cout << "\b|";
- if (i % 4 == 2) cout << "\b/";
- if (i % 4 == 3) cout << "\b-";
- }
- cout << "\b";
- return;
- }
- int findMode(long double arr[], int numStats, modeArr mode[])
- {
- // Take in sorted data. Fall through passed array and modify modeArr struct base on results.
- // If not matching, make new struct value.
- // If matching, change count for struct value.
- // Re-sort based on count, highest counts first.
- // Return number of records created.
- // Then main() can output modes that match the count of entry 0.
- int returnVal = 0;
- mode[0].count = 1;
- mode[0].value = arr[0];
- for (int k = 1; k < numStats; k++)
- {
- if (mode[returnVal].value == arr[k])
- mode[returnVal].count++;
- else
- {
- returnVal++;
- mode[returnVal].count = 1;
- mode[returnVal].value = arr[k];
- }
- }
- returnVal++;
- int i, j, temp;
- long double tempLong;
- for (i=0; i< (returnVal -1); i++)
- {
- for(j = (i+1); j < returnVal; j++)
- {
- if (mode[i].count < mode[j].count)
- {
- temp = mode[i].count;
- mode[i].count = mode[j].count;
- mode[j].count = temp;
- tempLong = mode[i].value;
- mode[i].value = mode[j].value;
- mode[j].value = temp;
- }
- }
- }
- return (returnVal);
- }
- float findStdDev (long double arr[], int numStats)
- {
- long double mean, sumOfSquares = 0.0;
- float stdDev;
- mean = findMean(arr, numStats);
- for (int i=0; i < numStats; i++)
- sumOfSquares = sumOfSquares + (arr[i] * arr[i]);
- stdDev = static_cast<float>(sqrt((sumOfSquares / numStats)- (mean * mean)));
- return(stdDev);
- }
- void seedStats(long double arr0[], int& i0, long double arr1[], int& i1)
- {
- int choice = 1;
- do
- {
- switch(choice)
- {
- case 0:
- cout << "Returning to Load, generate, or manipulate data.\n\n";
- break;
- case 1:
- // 1 2 3 4 5 6 7 8
- //12345678901234567890123456789012345678901234567890123456789012345678901234567890
- cout << "You have a few optons.\n"
- << " 0: Exit\n"
- << " 1: Show this list again.\n"
- << " 2: Load 13 unsorted varriables into stats array 1.\n"
- << " 3: Load 30 unsorted varriables into stats array 2.\n"
- << " 4: Load a set of 10 into each stats array.\n\n"
- << "2 and 3 are meant for testing Sort, Measures of Central Tendency, Z Ratio \n"
- << "Operations, and menu un-hiding.\n\n"
- << "4 is a set designed for Correlation Analysis and should NOT be sorted.\n\n";
- break;
- case 2:
- arr0[0] = 7.0; arr0[1] = 9.0; arr0[5] = 22.0; arr0[3] = 25.0; arr0[4] = 8.0; arr0[7] = 13.0;
- arr0[6] = 21.0; arr0[2] = 15.0; arr0[8] = 15.0; arr0[9] = 15.0; arr0[10] = 17.0; arr0[11] = 17.0; arr0[12] = 28.0;
- i0 = 13;
- cout << "Loaded data into stats array 1.\n\n";
- break;
- case 3:
- arr1[0] = 15; arr1[1] = 10; arr1[2] = 20; arr1[3] = 18; arr1[4] = 18; arr1[5] = 11; arr1[6] = 11; arr1[7] = 11;
- arr1[8] = 11; arr1[9] = 12; arr1[10] = 12; arr1[11] = 12; arr1[12] = 10; arr1[13] = 9; arr1[14] = 9; arr1[15] = 8;
- arr1[16] = 9; arr1[17] = 9; arr1[18] = 11; arr1[19] = 11; arr1[20] = 11; arr1[21] = 15; arr1[22] = 12; arr1[23] = 12;
- arr1[24] = 12; arr1[25] = 10; arr1[26] = 12; arr1[27] = 12; arr1[28] = 15; arr1[29] = 12;
- i1 = 30;
- cout << "Loaded data into stats array 2.\n\n";
- break;
- case 4:
- arr0[0] = 9.0; arr0[1] = 6.0; arr0[2] = 12.0; arr0[3] = 7.0; arr0[4] = 10.0;
- arr0[5] = 4.0; arr0[6] = 9.0; arr0[7] = 10.0; arr0[8] = 9.0; arr0[9] = 2.0;
- i0 = 10;
- arr1[0] = 6; arr1[1] = 8; arr1[2] = 2; arr1[3] = 6; arr1[4] = 10;
- arr1[5] = 11; arr1[6] = 11; arr1[7] = 9; arr1[8] = 9; arr1[9] = 13;
- i1 = 10;
- cout << "Loaded data into both stats array 1 and 2.\n\n";
- break;
- }
- choice = inVal(4);
- }while (choice);
- return;
- }
- int whichArr()
- {
- int wA;
- while ((cout << "Which set of stats? (1 or 2) ") &&
- (!(cin >> wA) || wA < 1 || wA > 2))
- {
- cout << "Only enter 1 or 2: ";
- cin.clear();
- cin.ignore(numeric_limits<streamsize>::max(), '\n');
- }
- cout << endl;
- return (wA - 1);
- }
- float zScore(float sD, long double mean, long double rS)
- {
- float zS;
- zS = static_cast<float>((rS - mean)/sD);
- return zS;
- }
- void zRatio2Raw(float sD, long double mean, float zR)
- {
- float rS, zS;
- zS = zRatio2Score(zR);
- rS = mean + (zS * sD);
- cout << "The Z Ratio " << (zR*100) << "% is a of raw score of " << rS << endl
- << "which is a Z Score of " << zS << " in SD units.\n\n";
- }
- long double longDubIn()
- {
- long double lD;
- while ((cout << "Input value: ") &&
- (!(cin >> lD) || lD < -9999999999.999999999 || lD > 9999999999.999999999))
- {
- cout << "Enter a numeric value between + or - 9999999999.999999999: ";
- cin.clear();
- cin.ignore(numeric_limits<streamsize>::max(), '\n');
- }
- cout << endl;
- return (lD);
- }
- float floatIn(float range)
- {
- float f, rN = (-1.0 * range);
- while ((cout << "Input value: ") &&
- (!(cin >> f) || f < rN || f > range))
- {
- cout << "Enter a numeric value between + or - " << range << ": ";
- cin.clear();
- cin.ignore(numeric_limits<streamsize>::max(), '\n');
- }
- cout << endl;
- return (f);
- }
- float zRatio(float zS)
- {
- if (zS < 0) zS *= -1.0;
- float zR;
- int split;
- if (zS < 1) split = 0;
- else if (zS < 2) split = 1;
- else split = 2;
- switch (split)
- {
- case 0:
- if (zS >= 0.00 && zS < 0.01) zR = static_cast<float>(0.0000);
- else if (zS >= 0.01 && zS < 0.02) zR = static_cast<float>(0.004);
- else if (zS >= 0.02 && zS < 0.03) zR = static_cast<float>(0.008);
- else if (zS >= 0.03 && zS < 0.04) zR = static_cast<float>(0.012);
- else if (zS >= 0.04 && zS < 0.05) zR = static_cast<float>(0.016);
- else if (zS >= 0.05 && zS < 0.06) zR = static_cast<float>(0.0199);
- else if (zS >= 0.06 && zS < 0.07) zR = static_cast<float>(0.0239);
- else if (zS >= 0.07 && zS < 0.08) zR = static_cast<float>(0.0279);
- else if (zS >= 0.08 && zS < 0.09) zR = static_cast<float>(0.0319);
- else if (zS >= 0.09 && zS < 0.10) zR = static_cast<float>(0.0359);
- else if (zS >= 0.10 && zS < 0.11) zR = static_cast<float>(0.0398);
- else if (zS >= 0.11 && zS < 0.12) zR = static_cast<float>(0.0438);
- else if (zS >= 0.12 && zS < 0.13) zR = static_cast<float>(0.0478);
- else if (zS >= 0.13 && zS < 0.14) zR = static_cast<float>(0.0517);
- else if (zS >= 0.14 && zS < 0.15) zR = static_cast<float>(0.0557);
- else if (zS >= 0.15 && zS < 0.16) zR = static_cast<float>(0.0596);
- else if (zS >= 0.16 && zS < 0.17) zR = static_cast<float>(0.0636);
- else if (zS >= 0.17 && zS < 0.18) zR = static_cast<float>(0.0675);
- else if (zS >= 0.18 && zS < 0.19) zR = static_cast<float>(0.0714);
- else if (zS >= 0.19 && zS < 0.20) zR = static_cast<float>(0.0753);
- else if (zS >= 0.20 && zS < 0.21) zR = static_cast<float>(0.0793);
- else if (zS >= 0.21 && zS < 0.22) zR = static_cast<float>(0.0832);
- else if (zS >= 0.22 && zS < 0.23) zR = static_cast<float>(0.0871);
- else if (zS >= 0.23 && zS < 0.24) zR = static_cast<float>(0.0910);
- else if (zS >= 0.24 && zS < 0.25) zR = static_cast<float>(0.0948);
- else if (zS >= 0.25 && zS < 0.26) zR = static_cast<float>(0.0987);
- else if (zS >= 0.26 && zS < 0.27) zR = static_cast<float>(0.1026);
- else if (zS >= 0.27 && zS < 0.28) zR = static_cast<float>(0.1064);
- else if (zS >= 0.28 && zS < 0.29) zR = static_cast<float>(0.1103);
- else if (zS >= 0.29 && zS < 0.30) zR = static_cast<float>(0.1141);
- else if (zS >= 0.30 && zS < 0.31) zR = static_cast<float>(0.1179);
- else if (zS >= 0.31 && zS < 0.32) zR = static_cast<float>(0.1217);
- else if (zS >= 0.32 && zS < 0.33) zR = static_cast<float>(0.1255);
- else if (zS >= 0.33 && zS < 0.34) zR = static_cast<float>(0.1293);
- else if (zS >= 0.34 && zS < 0.35) zR = static_cast<float>(0.1331);
- else if (zS >= 0.35 && zS < 0.36) zR = static_cast<float>(0.1368);
- else if (zS >= 0.36 && zS < 0.37) zR = static_cast<float>(0.1406);
- else if (zS >= 0.37 && zS < 0.38) zR = static_cast<float>(0.1443);
- else if (zS >= 0.38 && zS < 0.39) zR = static_cast<float>(0.1480);
- else if (zS >= 0.39 && zS < 0.40) zR = static_cast<float>(0.1517);
- else if (zS >= 0.40 && zS < 0.41) zR = static_cast<float>(0.1554);
- else if (zS >= 0.41 && zS < 0.42) zR = static_cast<float>(0.1591);
- else if (zS >= 0.42 && zS < 0.43) zR = static_cast<float>(0.1628);
- else if (zS >= 0.43 && zS < 0.44) zR = static_cast<float>(0.1664);
- else if (zS >= 0.44 && zS < 0.45) zR = static_cast<float>(0.17);
- else if (zS >= 0.45 && zS < 0.46) zR = static_cast<float>(0.1736);
- else if (zS >= 0.46 && zS < 0.47) zR = static_cast<float>(0.1772);
- else if (zS >= 0.47 && zS < 0.48) zR = static_cast<float>(0.1808);
- else if (zS >= 0.48 && zS < 0.49) zR = static_cast<float>(0.1844);
- else if (zS >= 0.49 && zS < 0.50) zR = static_cast<float>(0.1879);
- else if (zS >= 0.50 && zS < 0.51) zR = static_cast<float>(0.1915);
- else if (zS >= 0.51 && zS < 0.52) zR = static_cast<float>(0.195);
- else if (zS >= 0.52 && zS < 0.53) zR = static_cast<float>(0.1985);
- else if (zS >= 0.53 && zS < 0.54) zR = static_cast<float>(0.2019);
- else if (zS >= 0.54 && zS < 0.55) zR = static_cast<float>(0.2054);
- else if (zS >= 0.55 && zS < 0.56) zR = static_cast<float>(0.2088);
- else if (zS >= 0.56 && zS < 0.57) zR = static_cast<float>(0.2123);
- else if (zS >= 0.57 && zS < 0.58) zR = static_cast<float>(0.2157);
- else if (zS >= 0.58 && zS < 0.59) zR = static_cast<float>(0.2190);
- else if (zS >= 0.59 && zS < 0.60) zR = static_cast<float>(0.2224);
- else if (zS >= 0.60 && zS < 0.61) zR = static_cast<float>(0.2257);
- else if (zS >= 0.61 && zS < 0.62) zR = static_cast<float>(0.2291);
- else if (zS >= 0.62 && zS < 0.63) zR = static_cast<float>(0.2324);
- else if (zS >= 0.63 && zS < 0.64) zR = static_cast<float>(0.2357);
- else if (zS >= 0.64 && zS < 0.65) zR = static_cast<float>(0.2389);
- else if (zS >= 0.65 && zS < 0.66) zR = static_cast<float>(0.2422);
- else if (zS >= 0.66 && zS < 0.67) zR = static_cast<float>(0.2454);
- else if (zS >= 0.67 && zS < 0.68) zR = static_cast<float>(0.2486);
- else if (zS >= 0.68 && zS < 0.69) zR = static_cast<float>(0.2517);
- else if (zS >= 0.69 && zS < 0.70) zR = static_cast<float>(0.2549);
- else if (zS >= 0.70 && zS < 0.71) zR = static_cast<float>(0.258);
- else if (zS >= 0.71 && zS < 0.72) zR = static_cast<float>(0.2611);
- else if (zS >= 0.72 && zS < 0.73) zR = static_cast<float>(0.2642);
- else if (zS >= 0.73 && zS < 0.74) zR = static_cast<float>(0.2673);
- else if (zS >= 0.74 && zS < 0.75) zR = static_cast<float>(0.2704);
- else if (zS >= 0.75 && zS < 0.76) zR = static_cast<float>(0.2734);
- else if (zS >= 0.76 && zS < 0.77) zR = static_cast<float>(0.2764);
- else if (zS >= 0.77 && zS < 0.78) zR = static_cast<float>(0.2794);
- else if (zS >= 0.78 && zS < 0.79) zR = static_cast<float>(0.2823);
- else if (zS >= 0.79 && zS < 0.80) zR = static_cast<float>(0.2852);
- else if (zS >= 0.80 && zS < 0.81) zR = static_cast<float>(0.2881);
- else if (zS >= 0.81 && zS < 0.82) zR = static_cast<float>(0.291);
- else if (zS >= 0.82 && zS < 0.83) zR = static_cast<float>(0.2939);
- else if (zS >= 0.83 && zS < 0.84) zR = static_cast<float>(0.2967);
- else if (zS >= 0.84 && zS < 0.85) zR = static_cast<float>(0.2995);
- else if (zS >= 0.85 && zS < 0.86) zR = static_cast<float>(0.3023);
- else if (zS >= 0.86 && zS < 0.87) zR = static_cast<float>(0.3051);
- else if (zS >= 0.87 && zS < 0.88) zR = static_cast<float>(0.3078);
- else if (zS >= 0.88 && zS < 0.89) zR = static_cast<float>(0.3106);
- else if (zS >= 0.89 && zS < 0.90) zR = static_cast<float>(0.3133);
- else if (zS >= 0.90 && zS < 0.91) zR = static_cast<float>(0.3159);
- else if (zS >= 0.91 && zS < 0.92) zR = static_cast<float>(0.3186);
- else if (zS >= 0.92 && zS < 0.93) zR = static_cast<float>(0.3212);
- else if (zS >= 0.93 && zS < 0.94) zR = static_cast<float>(0.3238);
- else if (zS >= 0.94 && zS < 0.95) zR = static_cast<float>(0.3264);
- else if (zS >= 0.95 && zS < 0.96) zR = static_cast<float>(0.3289);
- else if (zS >= 0.96 && zS < 0.97) zR = static_cast<float>(0.3315);
- else if (zS >= 0.97 && zS < 0.98) zR = static_cast<float>(0.334);
- else if (zS >= 0.98 && zS < 0.99) zR = static_cast<float>(0.3365);
- else zR = static_cast<float>(0.3389);
- break;
- case 1:
- if (zS >= 1.00 && zS < 1.01) zR = static_cast<float>(0.3413);
- else if (zS >= 1.01 && zS < 1.02) zR = static_cast<float>(0.3438);
- else if (zS >= 1.02 && zS < 1.03) zR = static_cast<float>(0.3461);
- else if (zS >= 1.03 && zS < 1.04) zR = static_cast<float>(0.3485);
- else if (zS >= 1.04 && zS < 1.05) zR = static_cast<float>(0.3508);
- else if (zS >= 1.05 && zS < 1.06) zR = static_cast<float>(0.3531);
- else if (zS >= 1.06 && zS < 1.07) zR = static_cast<float>(0.3554);
- else if (zS >= 1.07 && zS < 1.08) zR = static_cast<float>(0.3577);
- else if (zS >= 1.08 && zS < 1.09) zR = static_cast<float>(0.3599);
- else if (zS >= 1.09 && zS < 1.10) zR = static_cast<float>(0.3621);
- else if (zS >= 1.10 && zS < 1.11) zR = static_cast<float>(0.3643);
- else if (zS >= 1.11 && zS < 1.12) zR = static_cast<float>(0.3665);
- else if (zS >= 1.12 && zS < 1.13) zR = static_cast<float>(0.3686);
- else if (zS >= 1.13 && zS < 1.14) zR = static_cast<float>(0.3708);
- else if (zS >= 1.14 && zS < 1.15) zR = static_cast<float>(0.3729);
- else if (zS >= 1.15 && zS < 1.16) zR = static_cast<float>(0.3749);
- else if (zS >= 1.16 && zS < 1.17) zR = static_cast<float>(0.377);
- else if (zS >= 1.17 && zS < 1.18) zR = static_cast<float>(0.379);
- else if (zS >= 1.18 && zS < 1.19) zR = static_cast<float>(0.381);
- else if (zS >= 1.19 && zS < 1.20) zR = static_cast<float>(0.383);
- else if (zS >= 1.20 && zS < 1.21) zR = static_cast<float>(0.3849);
- else if (zS >= 1.21 && zS < 1.22) zR = static_cast<float>(0.3869);
- else if (zS >= 1.22 && zS < 1.23) zR = static_cast<float>(0.3888);
- else if (zS >= 1.23 && zS < 1.24) zR = static_cast<float>(0.3907);
- else if (zS >= 1.24 && zS < 1.25) zR = static_cast<float>(0.3925);
- else if (zS >= 1.25 && zS < 1.26) zR = static_cast<float>(0.3944);
- else if (zS >= 1.26 && zS < 1.27) zR = static_cast<float>(0.3962);
- else if (zS >= 1.27 && zS < 1.28) zR = static_cast<float>(0.398);
- else if (zS >= 1.28 && zS < 1.29) zR = static_cast<float>(0.3997);
- else if (zS >= 1.29 && zS < 1.30) zR = static_cast<float>(0.4015);
- else if (zS >= 1.30 && zS < 1.31) zR = static_cast<float>(0.4032);
- else if (zS >= 1.31 && zS < 1.32) zR = static_cast<float>(0.4049);
- else if (zS >= 1.32 && zS < 1.33) zR = static_cast<float>(0.4066);
- else if (zS >= 1.33 && zS < 1.34) zR = static_cast<float>(0.4082);
- else if (zS >= 1.34 && zS < 1.35) zR = static_cast<float>(0.4099);
- else if (zS >= 1.35 && zS < 1.36) zR = static_cast<float>(0.4115);
- else if (zS >= 1.36 && zS < 1.37) zR = static_cast<float>(0.4131);
- else if (zS >= 1.37 && zS < 1.38) zR = static_cast<float>(0.4147);
- else if (zS >= 1.38 && zS < 1.39) zR = static_cast<float>(0.4162);
- else if (zS >= 1.39 && zS < 1.40) zR = static_cast<float>(0.4177);
- else if (zS >= 1.40 && zS < 1.41) zR = static_cast<float>(0.4192);
- else if (zS >= 1.41 && zS < 1.42) zR = static_cast<float>(0.4207);
- else if (zS >= 1.42 && zS < 1.43) zR = static_cast<float>(0.4222);
- else if (zS >= 1.43 && zS < 1.44) zR = static_cast<float>(0.4236);
- else if (zS >= 1.44 && zS < 1.45) zR = static_cast<float>(0.4251);
- else if (zS >= 1.45 && zS < 1.46) zR = static_cast<float>(0.4265);
- else if (zS >= 1.46 && zS < 1.47) zR = static_cast<float>(0.4279);
- else if (zS >= 1.47 && zS < 1.48) zR = static_cast<float>(0.4292);
- else if (zS >= 1.48 && zS < 1.49) zR = static_cast<float>(0.4306);
- else if (zS >= 1.49 && zS < 1.50) zR = static_cast<float>(0.4319);
- else if (zS >= 1.50 && zS < 1.51) zR = static_cast<float>(0.4332);
- else if (zS >= 1.51 && zS < 1.52) zR = static_cast<float>(0.4345);
- else if (zS >= 1.52 && zS < 1.53) zR = static_cast<float>(0.4357);
- else if (zS >= 1.53 && zS < 1.54) zR = static_cast<float>(0.4370);
- else if (zS >= 1.54 && zS < 1.55) zR = static_cast<float>(0.4382);
- else if (zS >= 1.55 && zS < 1.56) zR = static_cast<float>(0.4394);
- else if (zS >= 1.56 && zS < 1.57) zR = static_cast<float>(0.4406);
- else if (zS >= 1.57 && zS < 1.58) zR = static_cast<float>(0.4418);
- else if (zS >= 1.58 && zS < 1.59) zR = static_cast<float>(0.4429);
- else if (zS >= 1.59 && zS < 1.60) zR = static_cast<float>(0.4441);
- else if (zS >= 1.60 && zS < 1.61) zR = static_cast<float>(0.4452);
- else if (zS >= 1.61 && zS < 1.62) zR = static_cast<float>(0.4463);
- else if (zS >= 1.62 && zS < 1.63) zR = static_cast<float>(0.4474);
- else if (zS >= 1.63 && zS < 1.64) zR = static_cast<float>(0.4484);
- else if (zS >= 1.64 && zS < 1.65) zR = static_cast<float>(0.4495);
- else if (zS >= 1.65 && zS < 1.66) zR = static_cast<float>(0.4505);
- else if (zS >= 1.66 && zS < 1.67) zR = static_cast<float>(0.4515);
- else if (zS >= 1.67 && zS < 1.68) zR = static_cast<float>(0.4525);
- else if (zS >= 1.68 && zS < 1.69) zR = static_cast<float>(0.4535);
- else if (zS >= 1.69 && zS < 1.70) zR = static_cast<float>(0.4545);
- else if (zS >= 1.70 && zS < 1.71) zR = static_cast<float>(0.4554);
- else if (zS >= 1.71 && zS < 1.72) zR = static_cast<float>(0.4564);
- else if (zS >= 1.72 && zS < 1.73) zR = static_cast<float>(0.4573);
- else if (zS >= 1.73 && zS < 1.74) zR = static_cast<float>(0.4582);
- else if (zS >= 1.74 && zS < 1.75) zR = static_cast<float>(0.4591);
- else if (zS >= 1.75 && zS < 1.76) zR = static_cast<float>(0.4599);
- else if (zS >= 1.76 && zS < 1.77) zR = static_cast<float>(0.4608);
- else if (zS >= 1.77 && zS < 1.78) zR = static_cast<float>(0.4616);
- else if (zS >= 1.78 && zS < 1.79) zR = static_cast<float>(0.4625);
- else if (zS >= 1.79 && zS < 1.80) zR = static_cast<float>(0.4633);
- else if (zS >= 1.80 && zS < 1.81) zR = static_cast<float>(0.4641);
- else if (zS >= 1.81 && zS < 1.82) zR = static_cast<float>(0.4649);
- else if (zS >= 1.82 && zS < 1.83) zR = static_cast<float>(0.4656);
- else if (zS >= 1.83 && zS < 1.84) zR = static_cast<float>(0.4664);
- else if (zS >= 1.84 && zS < 1.85) zR = static_cast<float>(0.4671);
- else if (zS >= 1.85 && zS < 1.86) zR = static_cast<float>(0.4678);
- else if (zS >= 1.86 && zS < 1.87) zR = static_cast<float>(0.4686);
- else if (zS >= 1.87 && zS < 1.88) zR = static_cast<float>(0.4693);
- else if (zS >= 1.88 && zS < 1.89) zR = static_cast<float>(0.4699);
- else if (zS >= 1.89 && zS < 1.90) zR = static_cast<float>(0.4706);
- else if (zS >= 1.90 && zS < 1.91) zR = static_cast<float>(0.4713);
- else if (zS >= 1.91 && zS < 1.92) zR = static_cast<float>(0.4719);
- else if (zS >= 1.92 && zS < 1.93) zR = static_cast<float>(0.4726);
- else if (zS >= 1.93 && zS < 1.94) zR = static_cast<float>(0.4732);
- else if (zS >= 1.94 && zS < 1.95) zR = static_cast<float>(0.4738);
- else if (zS >= 1.95 && zS < 1.96) zR = static_cast<float>(0.4744);
- else if (zS >= 1.96 && zS < 1.97) zR = static_cast<float>(0.4750);
- else if (zS >= 1.97 && zS < 1.98) zR = static_cast<float>(0.4756);
- else if (zS >= 1.98 && zS < 1.99) zR = static_cast<float>(0.4761);
- else zR = static_cast<float>(0.4767);
- break;
- case 2:
- if (zS >= 2.00 && zS < 2.01) zR = static_cast<float>(0.4772);
- else if (zS >= 2.01 && zS < 2.02) zR = static_cast<float>(0.4778);
- else if (zS >= 2.02 && zS < 2.03) zR = static_cast<float>(0.4783);
- else if (zS >= 2.03 && zS < 2.04) zR = static_cast<float>(0.4788);
- else if (zS >= 2.04 && zS < 2.05) zR = static_cast<float>(0.4793);
- else if (zS >= 2.05 && zS < 2.06) zR = static_cast<float>(0.4798);
- else if (zS >= 2.06 && zS < 2.07) zR = static_cast<float>(0.4803);
- else if (zS >= 2.07 && zS < 2.08) zR = static_cast<float>(0.4808);
- else if (zS >= 2.08 && zS < 2.09) zR = static_cast<float>(0.4812);
- else if (zS >= 2.09 && zS < 2.10) zR = static_cast<float>(0.4817);
- else if (zS >= 2.10 && zS < 2.11) zR = static_cast<float>(0.4821);
- else if (zS >= 2.11 && zS < 2.12) zR = static_cast<float>(0.4826);
- else if (zS >= 2.12 && zS < 2.13) zR = static_cast<float>(0.4830);
- else if (zS >= 2.13 && zS < 2.14) zR = static_cast<float>(0.4834);
- else if (zS >= 2.14 && zS < 2.15) zR = static_cast<float>(0.4838);
- else if (zS >= 2.15 && zS < 2.16) zR = static_cast<float>(0.4842);
- else if (zS >= 2.16 && zS < 2.17) zR = static_cast<float>(0.4846);
- else if (zS >= 2.17 && zS < 2.18) zR = static_cast<float>(0.4850);
- else if (zS >= 2.18 && zS < 2.19) zR = static_cast<float>(0.4854);
- else if (zS >= 2.19 && zS < 2.20) zR = static_cast<float>(0.4857);
- else if (zS >= 2.20 && zS < 2.21) zR = static_cast<float>(0.4861);
- else if (zS >= 2.21 && zS < 2.22) zR = static_cast<float>(0.4864);
- else if (zS >= 2.22 && zS < 2.23) zR = static_cast<float>(0.4868);
- else if (zS >= 2.23 && zS < 2.24) zR = static_cast<float>(0.4871);
- else if (zS >= 2.24 && zS < 2.25) zR = static_cast<float>(0.4875);
- else if (zS >= 2.25 && zS < 2.26) zR = static_cast<float>(0.4878);
- else if (zS >= 2.26 && zS < 2.27) zR = static_cast<float>(0.4881);
- else if (zS >= 2.27 && zS < 2.28) zR = static_cast<float>(0.4884);
- else if (zS >= 2.28 && zS < 2.29) zR = static_cast<float>(0.4887);
- else if (zS >= 2.29 && zS < 2.30) zR = static_cast<float>(0.4890);
- else if (zS >= 2.30 && zS < 2.31) zR = static_cast<float>(0.4893);
- else if (zS >= 2.31 && zS < 2.32) zR = static_cast<float>(0.4896);
- else if (zS >= 2.32 && zS < 2.33) zR = static_cast<float>(0.4898);
- else if (zS >= 2.33 && zS < 2.34) zR = static_cast<float>(0.4901);
- else if (zS >= 2.34 && zS < 2.35) zR = static_cast<float>(0.4904);
- else if (zS >= 2.35 && zS < 2.36) zR = static_cast<float>(0.4906);
- else if (zS >= 2.36 && zS < 2.37) zR = static_cast<float>(0.4909);
- else if (zS >= 2.37 && zS < 2.38) zR = static_cast<float>(0.4911);
- else if (zS >= 2.38 && zS < 2.39) zR = static_cast<float>(0.4913);
- else if (zS >= 2.39 && zS < 2.40) zR = static_cast<float>(0.4916);
- else if (zS >= 2.40 && zS < 2.41) zR = static_cast<float>(0.4918);
- else if (zS >= 2.41 && zS < 2.42) zR = static_cast<float>(0.492);
- else if (zS >= 2.42 && zS < 2.43) zR = static_cast<float>(0.4922);
- else if (zS >= 2.43 && zS < 2.44) zR = static_cast<float>(0.4925);
- else if (zS >= 2.44 && zS < 2.45) zR = static_cast<float>(0.4927);
- else if (zS >= 2.45 && zS < 2.46) zR = static_cast<float>(0.4929);
- else if (zS >= 2.46 && zS < 2.47) zR = static_cast<float>(0.4931);
- else if (zS >= 2.47 && zS < 2.48) zR = static_cast<float>(0.4932);
- else if (zS >= 2.48 && zS < 2.49) zR = static_cast<float>(0.4934);
- else if (zS >= 2.49 && zS < 2.50) zR = static_cast<float>(0.4936);
- else if (zS >= 2.50 && zS < 2.51) zR = static_cast<float>(0.4938);
- else if (zS >= 2.51 && zS < 2.52) zR = static_cast<float>(0.494);
- else if (zS >= 2.52 && zS < 2.53) zR = static_cast<float>(0.4941);
- else if (zS >= 2.53 && zS < 2.54) zR = static_cast<float>(0.4943);
- else if (zS >= 2.54 && zS < 2.55) zR = static_cast<float>(0.4945);
- else if (zS >= 2.55 && zS < 2.56) zR = static_cast<float>(0.4946);
- else if (zS >= 2.56 && zS < 2.57) zR = static_cast<float>(0.4948);
- else if (zS >= 2.57 && zS < 2.58) zR = static_cast<float>(0.4949);
- else if (zS >= 2.58 && zS < 2.59) zR = static_cast<float>(0.4951);
- else if (zS >= 2.59 && zS < 2.60) zR = static_cast<float>(0.4952);
- else if (zS >= 2.60 && zS < 2.61) zR = static_cast<float>(0.4953);
- else if (zS >= 2.61 && zS < 2.62) zR = static_cast<float>(0.4955);
- else if (zS >= 2.62 && zS < 2.63) zR = static_cast<float>(0.4956);
- else if (zS >= 2.63 && zS < 2.64) zR = static_cast<float>(0.4957);
- else if (zS >= 2.64 && zS < 2.65) zR = static_cast<float>(0.4959);
- else if (zS >= 2.65 && zS < 2.66) zR = static_cast<float>(0.4960);
- else if (zS >= 2.66 && zS < 2.67) zR = static_cast<float>(0.4961);
- else if (zS >= 2.67 && zS < 2.68) zR = static_cast<float>(0.4962);
- else if (zS >= 2.68 && zS < 2.69) zR = static_cast<float>(0.4963);
- else if (zS >= 2.69 && zS < 2.70) zR = static_cast<float>(0.4964);
- else if (zS >= 2.70 && zS < 2.71) zR = static_cast<float>(0.4965);
- else if (zS >= 2.71 && zS < 2.72) zR = static_cast<float>(0.4966);
- else if (zS >= 2.72 && zS < 2.73) zR = static_cast<float>(0.4967);
- else if (zS >= 2.73 && zS < 2.74) zR = static_cast<float>(0.4968);
- else if (zS >= 2.74 && zS < 2.75) zR = static_cast<float>(0.4969);
- else if (zS >= 2.75 && zS < 2.76) zR = static_cast<float>(0.497);
- else if (zS >= 2.76 && zS < 2.77) zR = static_cast<float>(0.4971);
- else if (zS >= 2.77 && zS < 2.78) zR = static_cast<float>(0.4972);
- else if (zS >= 2.78 && zS < 2.79) zR = static_cast<float>(0.4973);
- else if (zS >= 2.79 && zS < 2.81) zR = static_cast<float>(0.4974);
- else if (zS >= 2.81 && zS < 2.82) zR = static_cast<float>(0.4975);
- else if (zS >= 2.82 && zS < 2.83) zR = static_cast<float>(0.4976);
- else if (zS >= 2.83 && zS < 2.85) zR = static_cast<float>(0.4977);
- else if (zS >= 2.85 && zS < 2.86) zR = static_cast<float>(0.4978);
- else if (zS >= 2.86 && zS < 2.88) zR = static_cast<float>(0.4979);
- else if (zS >= 2.88 && zS < 2.89) zR = static_cast<float>(0.498);
- else if (zS >= 2.89 && zS < 2.91) zR = static_cast<float>(0.4981);
- else if (zS >= 2.91 && zS < 2.93) zR = static_cast<float>(0.4982);
- else if (zS >= 2.93 && zS < 2.94) zR = static_cast<float>(0.4983);
- else if (zS >= 2.94 && zS < 2.96) zR = static_cast<float>(0.4984);
- else if (zS >= 2.96 && zS < 2.98) zR = static_cast<float>(0.4985);
- else if (zS >= 2.98 && zS < 3.00) zR = static_cast<float>(0.4986);
- else if (zS >= 3.00 && zS < 3.03) zR = static_cast<float>(0.4987);
- else if (zS >= 3.03 && zS < 3.05) zR = static_cast<float>(0.4988);
- else if (zS >= 3.05 && zS < 3.08) zR = static_cast<float>(0.4989);
- else if (zS >= 3.08 && zS < 3.11) zR = static_cast<float>(0.4990);
- else if (zS >= 3.11 && zS < 3.15) zR = static_cast<float>(0.4991);
- else if (zS >= 3.15 && zS < 3.18) zR = static_cast<float>(0.4992);
- else if (zS >= 3.18 && zS < 3.22) zR = static_cast<float>(0.4993);
- else if (zS >= 3.22 && zS < 3.27) zR = static_cast<float>(0.4994);
- else if (zS >= 3.27 && zS < 3.33) zR = static_cast<float>(0.4995);
- else if (zS >= 3.33 && zS < 3.39) zR = static_cast<float>(0.4996);
- else if (zS >= 3.39 && zS < 3.49) zR = static_cast<float>(0.4997);
- else if (zS >= 3.49 && zS < 3.70) zR = static_cast<float>(0.4998);
- else if (zS >= 3.70) zR = static_cast<float>(0.4999);
- }
- return (zR);
- }//zRatio(float zS)
- float zRatio2Score(float zR)
- {
- float signFlip;
- if (zR < 0.0) signFlip = -1.0; else signFlip = 1.0;
- zR *= signFlip;
- float zS;
- int split;
- if (zR < 0.3413) split = 0;
- else if (zR < 0.4772) split = 1;
- else split = 2;
- switch (split)
- {
- case 0:
- if (zR >= 0 && zR < 0.004 ) zS = static_cast<float>( 0 );
- else if (zR >= 0.004 && zR < 0.008 ) zS = static_cast<float>( 0.01 );
- else if (zR >= 0.008 && zR < 0.012 ) zS = static_cast<float>( 0.02 );
- else if (zR >= 0.012 && zR < 0.016 ) zS = static_cast<float>( 0.03 );
- else if (zR >= 0.016 && zR < 0.0199 ) zS = static_cast<float>( 0.04 );
- else if (zR >= 0.0199 && zR < 0.0239 ) zS = static_cast<float>( 0.05 );
- else if (zR >= 0.0239 && zR < 0.0279 ) zS = static_cast<float>( 0.06 );
- else if (zR >= 0.0279 && zR < 0.0319 ) zS = static_cast<float>( 0.07 );
- else if (zR >= 0.0319 && zR < 0.0359 ) zS = static_cast<float>( 0.08 );
- else if (zR >= 0.0359 && zR < 0.0398 ) zS = static_cast<float>( 0.09 );
- else if (zR >= 0.0398 && zR < 0.0438 ) zS = static_cast<float>( 0.1 );
- else if (zR >= 0.0438 && zR < 0.0478 ) zS = static_cast<float>( 0.11 );
- else if (zR >= 0.0478 && zR < 0.0517 ) zS = static_cast<float>( 0.12 );
- else if (zR >= 0.0517 && zR < 0.0557 ) zS = static_cast<float>( 0.13 );
- else if (zR >= 0.0557 && zR < 0.0596 ) zS = static_cast<float>( 0.14 );
- else if (zR >= 0.0596 && zR < 0.0636 ) zS = static_cast<float>( 0.15 );
- else if (zR >= 0.0636 && zR < 0.0675 ) zS = static_cast<float>( 0.16 );
- else if (zR >= 0.0675 && zR < 0.0714 ) zS = static_cast<float>( 0.17 );
- else if (zR >= 0.0714 && zR < 0.0753 ) zS = static_cast<float>( 0.18 );
- else if (zR >= 0.0753 && zR < 0.0793 ) zS = static_cast<float>( 0.19 );
- else if (zR >= 0.0793 && zR < 0.0832 ) zS = static_cast<float>( 0.2 );
- else if (zR >= 0.0832 && zR < 0.0871 ) zS = static_cast<float>( 0.21 );
- else if (zR >= 0.0871 && zR < 0.091 ) zS = static_cast<float>( 0.22 );
- else if (zR >= 0.091 && zR < 0.0948 ) zS = static_cast<float>( 0.23 );
- else if (zR >= 0.0948 && zR < 0.0987 ) zS = static_cast<float>( 0.24 );
- else if (zR >= 0.0987 && zR < 0.1026 ) zS = static_cast<float>( 0.25 );
- else if (zR >= 0.1026 && zR < 0.1064 ) zS = static_cast<float>( 0.26 );
- else if (zR >= 0.1064 && zR < 0.1103 ) zS = static_cast<float>( 0.27 );
- else if (zR >= 0.1103 && zR < 0.1141 ) zS = static_cast<float>( 0.28 );
- else if (zR >= 0.1141 && zR < 0.1179 ) zS = static_cast<float>( 0.29 );
- else if (zR >= 0.1179 && zR < 0.1217 ) zS = static_cast<float>( 0.3 );
- else if (zR >= 0.1217 && zR < 0.1255 ) zS = static_cast<float>( 0.31 );
- else if (zR >= 0.1255 && zR < 0.1293 ) zS = static_cast<float>( 0.32 );
- else if (zR >= 0.1293 && zR < 0.1331 ) zS = static_cast<float>( 0.33 );
- else if (zR >= 0.1331 && zR < 0.1368 ) zS = static_cast<float>( 0.34 );
- else if (zR >= 0.1368 && zR < 0.1406 ) zS = static_cast<float>( 0.35 );
- else if (zR >= 0.1406 && zR < 0.1443 ) zS = static_cast<float>( 0.36 );
- else if (zR >= 0.1443 && zR < 0.148 ) zS = static_cast<float>( 0.37 );
- else if (zR >= 0.148 && zR < 0.1517 ) zS = static_cast<float>( 0.38 );
- else if (zR >= 0.1517 && zR < 0.1554 ) zS = static_cast<float>( 0.39 );
- else if (zR >= 0.1554 && zR < 0.1591 ) zS = static_cast<float>( 0.4 );
- else if (zR >= 0.1591 && zR < 0.1628 ) zS = static_cast<float>( 0.41 );
- else if (zR >= 0.1628 && zR < 0.1664 ) zS = static_cast<float>( 0.42 );
- else if (zR >= 0.1664 && zR < 0.17 ) zS = static_cast<float>( 0.43 );
- else if (zR >= 0.17 && zR < 0.1736 ) zS = static_cast<float>( 0.44 );
- else if (zR >= 0.1736 && zR < 0.1772 ) zS = static_cast<float>( 0.45 );
- else if (zR >= 0.1772 && zR < 0.1808 ) zS = static_cast<float>( 0.46 );
- else if (zR >= 0.1808 && zR < 0.1844 ) zS = static_cast<float>( 0.47 );
- else if (zR >= 0.1844 && zR < 0.1879 ) zS = static_cast<float>( 0.48 );
- else if (zR >= 0.1879 && zR < 0.1915 ) zS = static_cast<float>( 0.49 );
- else if (zR >= 0.1915 && zR < 0.195 ) zS = static_cast<float>( 0.5 );
- else if (zR >= 0.195 && zR < 0.1985 ) zS = static_cast<float>( 0.51 );
- else if (zR >= 0.1985 && zR < 0.2019 ) zS = static_cast<float>( 0.52 );
- else if (zR >= 0.2019 && zR < 0.2054 ) zS = static_cast<float>( 0.53 );
- else if (zR >= 0.2054 && zR < 0.2088 ) zS = static_cast<float>( 0.54 );
- else if (zR >= 0.2088 && zR < 0.2123 ) zS = static_cast<float>( 0.55 );
- else if (zR >= 0.2123 && zR < 0.2157 ) zS = static_cast<float>( 0.56 );
- else if (zR >= 0.2157 && zR < 0.219 ) zS = static_cast<float>( 0.57 );
- else if (zR >= 0.219 && zR < 0.2224 ) zS = static_cast<float>( 0.58 );
- else if (zR >= 0.2224 && zR < 0.2257 ) zS = static_cast<float>( 0.59 );
- else if (zR >= 0.2257 && zR < 0.2291 ) zS = static_cast<float>( 0.6 );
- else if (zR >= 0.2291 && zR < 0.2324 ) zS = static_cast<float>( 0.61 );
- else if (zR >= 0.2324 && zR < 0.2357 ) zS = static_cast<float>( 0.62 );
- else if (zR >= 0.2357 && zR < 0.2389 ) zS = static_cast<float>( 0.63 );
- else if (zR >= 0.2389 && zR < 0.2422 ) zS = static_cast<float>( 0.64 );
- else if (zR >= 0.2422 && zR < 0.2454 ) zS = static_cast<float>( 0.65 );
- else if (zR >= 0.2454 && zR < 0.2486 ) zS = static_cast<float>( 0.66 );
- else if (zR >= 0.2486 && zR < 0.2517 ) zS = static_cast<float>( 0.67 );
- else if (zR >= 0.2517 && zR < 0.2549 ) zS = static_cast<float>( 0.68 );
- else if (zR >= 0.2549 && zR < 0.258 ) zS = static_cast<float>( 0.69 );
- else if (zR >= 0.258 && zR < 0.2611 ) zS = static_cast<float>( 0.7 );
- else if (zR >= 0.2611 && zR < 0.2642 ) zS = static_cast<float>( 0.71 );
- else if (zR >= 0.2642 && zR < 0.2673 ) zS = static_cast<float>( 0.72 );
- else if (zR >= 0.2673 && zR < 0.2704 ) zS = static_cast<float>( 0.73 );
- else if (zR >= 0.2704 && zR < 0.2734 ) zS = static_cast<float>( 0.74 );
- else if (zR >= 0.2734 && zR < 0.2764 ) zS = static_cast<float>( 0.75 );
- else if (zR >= 0.2764 && zR < 0.2794 ) zS = static_cast<float>( 0.76 );
- else if (zR >= 0.2794 && zR < 0.2823 ) zS = static_cast<float>( 0.77 );
- else if (zR >= 0.2823 && zR < 0.2852 ) zS = static_cast<float>( 0.78 );
- else if (zR >= 0.2852 && zR < 0.2881 ) zS = static_cast<float>( 0.79 );
- else if (zR >= 0.2881 && zR < 0.291 ) zS = static_cast<float>( 0.8 );
- else if (zR >= 0.291 && zR < 0.2939 ) zS = static_cast<float>( 0.81 );
- else if (zR >= 0.2939 && zR < 0.2967 ) zS = static_cast<float>( 0.82 );
- else if (zR >= 0.2967 && zR < 0.2995 ) zS = static_cast<float>( 0.83 );
- else if (zR >= 0.2995 && zR < 0.3023 ) zS = static_cast<float>( 0.84 );
- else if (zR >= 0.3023 && zR < 0.3051 ) zS = static_cast<float>( 0.85 );
- else if (zR >= 0.3051 && zR < 0.3078 ) zS = static_cast<float>( 0.86 );
- else if (zR >= 0.3078 && zR < 0.3106 ) zS = static_cast<float>( 0.87 );
- else if (zR >= 0.3106 && zR < 0.3133 ) zS = static_cast<float>( 0.88 );
- else if (zR >= 0.3133 && zR < 0.3159 ) zS = static_cast<float>( 0.89 );
- else if (zR >= 0.3159 && zR < 0.3186 ) zS = static_cast<float>( 0.9 );
- else if (zR >= 0.3186 && zR < 0.3212 ) zS = static_cast<float>( 0.91 );
- else if (zR >= 0.3212 && zR < 0.3238 ) zS = static_cast<float>( 0.92 );
- else if (zR >= 0.3238 && zR < 0.3264 ) zS = static_cast<float>( 0.93 );
- else if (zR >= 0.3264 && zR < 0.3289 ) zS = static_cast<float>( 0.94 );
- else if (zR >= 0.3289 && zR < 0.3315 ) zS = static_cast<float>( 0.95 );
- else if (zR >= 0.3315 && zR < 0.334 ) zS = static_cast<float>( 0.96 );
- else if (zR >= 0.334 && zR < 0.3365 ) zS = static_cast<float>( 0.97 );
- else if (zR >= 0.3365 && zR < 0.3389 ) zS = static_cast<float>( 0.98 );
- else zS = static_cast<float>( 0.99 );
- break;
- case 1:
- if (zR >= 0.3413 && zR < 0.3438 ) zS = static_cast<float>( 1 );
- else if (zR >= 0.3438 && zR < 0.3461 ) zS = static_cast<float>( 1.01 );
- else if (zR >= 0.3461 && zR < 0.3485 ) zS = static_cast<float>( 1.02 );
- else if (zR >= 0.3485 && zR < 0.3508 ) zS = static_cast<float>( 1.03 );
- else if (zR >= 0.3508 && zR < 0.3531 ) zS = static_cast<float>( 1.04 );
- else if (zR >= 0.3531 && zR < 0.3554 ) zS = static_cast<float>( 1.05 );
- else if (zR >= 0.3554 && zR < 0.3577 ) zS = static_cast<float>( 1.06 );
- else if (zR >= 0.3577 && zR < 0.3599 ) zS = static_cast<float>( 1.07 );
- else if (zR >= 0.3599 && zR < 0.3621 ) zS = static_cast<float>( 1.08 );
- else if (zR >= 0.3621 && zR < 0.3643 ) zS = static_cast<float>( 1.09 );
- else if (zR >= 0.3643 && zR < 0.3665 ) zS = static_cast<float>( 1.1 );
- else if (zR >= 0.3665 && zR < 0.3686 ) zS = static_cast<float>( 1.11 );
- else if (zR >= 0.3686 && zR < 0.3708 ) zS = static_cast<float>( 1.12 );
- else if (zR >= 0.3708 && zR < 0.3729 ) zS = static_cast<float>( 1.13 );
- else if (zR >= 0.3729 && zR < 0.3749 ) zS = static_cast<float>( 1.14 );
- else if (zR >= 0.3749 && zR < 0.377 ) zS = static_cast<float>( 1.15 );
- else if (zR >= 0.377 && zR < 0.379 ) zS = static_cast<float>( 1.16 );
- else if (zR >= 0.379 && zR < 0.381 ) zS = static_cast<float>( 1.17 );
- else if (zR >= 0.381 && zR < 0.383 ) zS = static_cast<float>( 1.18 );
- else if (zR >= 0.383 && zR < 0.3849 ) zS = static_cast<float>( 1.19 );
- else if (zR >= 0.3849 && zR < 0.3869 ) zS = static_cast<float>( 1.2 );
- else if (zR >= 0.3869 && zR < 0.3888 ) zS = static_cast<float>( 1.21 );
- else if (zR >= 0.3888 && zR < 0.3907 ) zS = static_cast<float>( 1.22 );
- else if (zR >= 0.3907 && zR < 0.3925 ) zS = static_cast<float>( 1.23 );
- else if (zR >= 0.3925 && zR < 0.3944 ) zS = static_cast<float>( 1.24 );
- else if (zR >= 0.3944 && zR < 0.3962 ) zS = static_cast<float>( 1.25 );
- else if (zR >= 0.3962 && zR < 0.398 ) zS = static_cast<float>( 1.26 );
- else if (zR >= 0.398 && zR < 0.3997 ) zS = static_cast<float>( 1.27 );
- else if (zR >= 0.3997 && zR < 0.4015 ) zS = static_cast<float>( 1.28 );
- else if (zR >= 0.4015 && zR < 0.4032 ) zS = static_cast<float>( 1.29 );
- else if (zR >= 0.4032 && zR < 0.4049 ) zS = static_cast<float>( 1.3 );
- else if (zR >= 0.4049 && zR < 0.4066 ) zS = static_cast<float>( 1.31 );
- else if (zR >= 0.4066 && zR < 0.4082 ) zS = static_cast<float>( 1.32 );
- else if (zR >= 0.4082 && zR < 0.4099 ) zS = static_cast<float>( 1.33 );
- else if (zR >= 0.4099 && zR < 0.4115 ) zS = static_cast<float>( 1.34 );
- else if (zR >= 0.4115 && zR < 0.4131 ) zS = static_cast<float>( 1.35 );
- else if (zR >= 0.4131 && zR < 0.4147 ) zS = static_cast<float>( 1.36 );
- else if (zR >= 0.4147 && zR < 0.4162 ) zS = static_cast<float>( 1.37 );
- else if (zR >= 0.4162 && zR < 0.4177 ) zS = static_cast<float>( 1.38 );
- else if (zR >= 0.4177 && zR < 0.4192 ) zS = static_cast<float>( 1.39 );
- else if (zR >= 0.4192 && zR < 0.4207 ) zS = static_cast<float>( 1.4 );
- else if (zR >= 0.4207 && zR < 0.4222 ) zS = static_cast<float>( 1.41 );
- else if (zR >= 0.4222 && zR < 0.4236 ) zS = static_cast<float>( 1.42 );
- else if (zR >= 0.4236 && zR < 0.4251 ) zS = static_cast<float>( 1.43 );
- else if (zR >= 0.4251 && zR < 0.4265 ) zS = static_cast<float>( 1.44 );
- else if (zR >= 0.4265 && zR < 0.4279 ) zS = static_cast<float>( 1.45 );
- else if (zR >= 0.4279 && zR < 0.4292 ) zS = static_cast<float>( 1.46 );
- else if (zR >= 0.4292 && zR < 0.4306 ) zS = static_cast<float>( 1.47 );
- else if (zR >= 0.4306 && zR < 0.4319 ) zS = static_cast<float>( 1.48 );
- else if (zR >= 0.4319 && zR < 0.4332 ) zS = static_cast<float>( 1.49 );
- else if (zR >= 0.4332 && zR < 0.4345 ) zS = static_cast<float>( 1.5 );
- else if (zR >= 0.4345 && zR < 0.4357 ) zS = static_cast<float>( 1.51 );
- else if (zR >= 0.4357 && zR < 0.437 ) zS = static_cast<float>( 1.52 );
- else if (zR >= 0.437 && zR < 0.4382 ) zS = static_cast<float>( 1.53 );
- else if (zR >= 0.4382 && zR < 0.4394 ) zS = static_cast<float>( 1.54 );
- else if (zR >= 0.4394 && zR < 0.4406 ) zS = static_cast<float>( 1.55 );
- else if (zR >= 0.4406 && zR < 0.4418 ) zS = static_cast<float>( 1.56 );
- else if (zR >= 0.4418 && zR < 0.4429 ) zS = static_cast<float>( 1.57 );
- else if (zR >= 0.4429 && zR < 0.4441 ) zS = static_cast<float>( 1.58 );
- else if (zR >= 0.4441 && zR < 0.4452 ) zS = static_cast<float>( 1.59 );
- else if (zR >= 0.4452 && zR < 0.4463 ) zS = static_cast<float>( 1.6 );
- else if (zR >= 0.4463 && zR < 0.4474 ) zS = static_cast<float>( 1.61 );
- else if (zR >= 0.4474 && zR < 0.4484 ) zS = static_cast<float>( 1.62 );
- else if (zR >= 0.4484 && zR < 0.4495 ) zS = static_cast<float>( 1.63 );
- else if (zR >= 0.4495 && zR < 0.4505 ) zS = static_cast<float>( 1.64 );
- else if (zR >= 0.4505 && zR < 0.4515 ) zS = static_cast<float>( 1.65 );
- else if (zR >= 0.4515 && zR < 0.4525 ) zS = static_cast<float>( 1.66 );
- else if (zR >= 0.4525 && zR < 0.4535 ) zS = static_cast<float>( 1.67 );
- else if (zR >= 0.4535 && zR < 0.4545 ) zS = static_cast<float>( 1.68 );
- else if (zR >= 0.4545 && zR < 0.4554 ) zS = static_cast<float>( 1.69 );
- else if (zR >= 0.4554 && zR < 0.4564 ) zS = static_cast<float>( 1.7 );
- else if (zR >= 0.4564 && zR < 0.4573 ) zS = static_cast<float>( 1.71 );
- else if (zR >= 0.4573 && zR < 0.4582 ) zS = static_cast<float>( 1.72 );
- else if (zR >= 0.4582 && zR < 0.4591 ) zS = static_cast<float>( 1.73 );
- else if (zR >= 0.4591 && zR < 0.4599 ) zS = static_cast<float>( 1.74 );
- else if (zR >= 0.4599 && zR < 0.4608 ) zS = static_cast<float>( 1.75 );
- else if (zR >= 0.4608 && zR < 0.4616 ) zS = static_cast<float>( 1.76 );
- else if (zR >= 0.4616 && zR < 0.4625 ) zS = static_cast<float>( 1.77 );
- else if (zR >= 0.4625 && zR < 0.4633 ) zS = static_cast<float>( 1.78 );
- else if (zR >= 0.4633 && zR < 0.4641 ) zS = static_cast<float>( 1.79 );
- else if (zR >= 0.4641 && zR < 0.4649 ) zS = static_cast<float>( 1.8 );
- else if (zR >= 0.4649 && zR < 0.4656 ) zS = static_cast<float>( 1.81 );
- else if (zR >= 0.4656 && zR < 0.4664 ) zS = static_cast<float>( 1.82 );
- else if (zR >= 0.4664 && zR < 0.4671 ) zS = static_cast<float>( 1.83 );
- else if (zR >= 0.4671 && zR < 0.4678 ) zS = static_cast<float>( 1.84 );
- else if (zR >= 0.4678 && zR < 0.4686 ) zS = static_cast<float>( 1.85 );
- else if (zR >= 0.4686 && zR < 0.4693 ) zS = static_cast<float>( 1.86 );
- else if (zR >= 0.4693 && zR < 0.4699 ) zS = static_cast<float>( 1.87 );
- else if (zR >= 0.4699 && zR < 0.4706 ) zS = static_cast<float>( 1.88 );
- else if (zR >= 0.4706 && zR < 0.4713 ) zS = static_cast<float>( 1.89 );
- else if (zR >= 0.4713 && zR < 0.4719 ) zS = static_cast<float>( 1.9 );
- else if (zR >= 0.4719 && zR < 0.4726 ) zS = static_cast<float>( 1.91 );
- else if (zR >= 0.4726 && zR < 0.4732 ) zS = static_cast<float>( 1.92 );
- else if (zR >= 0.4732 && zR < 0.4738 ) zS = static_cast<float>( 1.93 );
- else if (zR >= 0.4738 && zR < 0.4744 ) zS = static_cast<float>( 1.94 );
- else if (zR >= 0.4744 && zR < 0.475 ) zS = static_cast<float>( 1.95 );
- else if (zR >= 0.475 && zR < 0.4756 ) zS = static_cast<float>( 1.96 );
- else if (zR >= 0.4756 && zR < 0.4761 ) zS = static_cast<float>( 1.97 );
- else if (zR >= 0.4761 && zR < 0.4767 ) zS = static_cast<float>( 1.98 );
- else zS = static_cast<float>( 1.99 );
- break;
- case 2:
- if (zR >= 0.4772 && zR < 0.4778 ) zS = static_cast<float>( 2 );
- else if (zR >= 0.4778 && zR < 0.4783 ) zS = static_cast<float>( 2.01 );
- else if (zR >= 0.4783 && zR < 0.4788 ) zS = static_cast<float>( 2.02 );
- else if (zR >= 0.4788 && zR < 0.4793 ) zS = static_cast<float>( 2.03 );
- else if (zR >= 0.4793 && zR < 0.4798 ) zS = static_cast<float>( 2.04 );
- else if (zR >= 0.4798 && zR < 0.4803 ) zS = static_cast<float>( 2.05 );
- else if (zR >= 0.4803 && zR < 0.4808 ) zS = static_cast<float>( 2.06 );
- else if (zR >= 0.4808 && zR < 0.4812 ) zS = static_cast<float>( 2.07 );
- else if (zR >= 0.4812 && zR < 0.4817 ) zS = static_cast<float>( 2.08 );
- else if (zR >= 0.4817 && zR < 0.4821 ) zS = static_cast<float>( 2.09 );
- else if (zR >= 0.4821 && zR < 0.4826 ) zS = static_cast<float>( 2.1 );
- else if (zR >= 0.4826 && zR < 0.483 ) zS = static_cast<float>( 2.11 );
- else if (zR >= 0.483 && zR < 0.4834 ) zS = static_cast<float>( 2.12 );
- else if (zR >= 0.4834 && zR < 0.4838 ) zS = static_cast<float>( 2.13 );
- else if (zR >= 0.4838 && zR < 0.4842 ) zS = static_cast<float>( 2.14 );
- else if (zR >= 0.4842 && zR < 0.4846 ) zS = static_cast<float>( 2.15 );
- else if (zR >= 0.4846 && zR < 0.485 ) zS = static_cast<float>( 2.16 );
- else if (zR >= 0.485 && zR < 0.4854 ) zS = static_cast<float>( 2.17 );
- else if (zR >= 0.4854 && zR < 0.4857 ) zS = static_cast<float>( 2.18 );
- else if (zR >= 0.4857 && zR < 0.4861 ) zS = static_cast<float>( 2.19 );
- else if (zR >= 0.4861 && zR < 0.4864 ) zS = static_cast<float>( 2.2 );
- else if (zR >= 0.4864 && zR < 0.4868 ) zS = static_cast<float>( 2.21 );
- else if (zR >= 0.4868 && zR < 0.4871 ) zS = static_cast<float>( 2.22 );
- else if (zR >= 0.4871 && zR < 0.4875 ) zS = static_cast<float>( 2.23 );
- else if (zR >= 0.4875 && zR < 0.4878 ) zS = static_cast<float>( 2.24 );
- else if (zR >= 0.4878 && zR < 0.4881 ) zS = static_cast<float>( 2.25 );
- else if (zR >= 0.4881 && zR < 0.4884 ) zS = static_cast<float>( 2.26 );
- else if (zR >= 0.4884 && zR < 0.4887 ) zS = static_cast<float>( 2.27 );
- else if (zR >= 0.4887 && zR < 0.489 ) zS = static_cast<float>( 2.28 );
- else if (zR >= 0.489 && zR < 0.4893 ) zS = static_cast<float>( 2.29 );
- else if (zR >= 0.4893 && zR < 0.4896 ) zS = static_cast<float>( 2.3 );
- else if (zR >= 0.4896 && zR < 0.4898 ) zS = static_cast<float>( 2.31 );
- else if (zR >= 0.4898 && zR < 0.4901 ) zS = static_cast<float>( 2.32 );
- else if (zR >= 0.4901 && zR < 0.4904 ) zS = static_cast<float>( 2.33 );
- else if (zR >= 0.4904 && zR < 0.4906 ) zS = static_cast<float>( 2.34 );
- else if (zR >= 0.4906 && zR < 0.4909 ) zS = static_cast<float>( 2.35 );
- else if (zR >= 0.4909 && zR < 0.4911 ) zS = static_cast<float>( 2.36 );
- else if (zR >= 0.4911 && zR < 0.4913 ) zS = static_cast<float>( 2.37 );
- else if (zR >= 0.4913 && zR < 0.4916 ) zS = static_cast<float>( 2.38 );
- else if (zR >= 0.4916 && zR < 0.4918 ) zS = static_cast<float>( 2.39 );
- else if (zR >= 0.4918 && zR < 0.492 ) zS = static_cast<float>( 2.4 );
- else if (zR >= 0.492 && zR < 0.4922 ) zS = static_cast<float>( 2.41 );
- else if (zR >= 0.4922 && zR < 0.4925 ) zS = static_cast<float>( 2.42 );
- else if (zR >= 0.4925 && zR < 0.4927 ) zS = static_cast<float>( 2.43 );
- else if (zR >= 0.4927 && zR < 0.4929 ) zS = static_cast<float>( 2.44 );
- else if (zR >= 0.4929 && zR < 0.4931 ) zS = static_cast<float>( 2.45 );
- else if (zR >= 0.4931 && zR < 0.4932 ) zS = static_cast<float>( 2.46 );
- else if (zR >= 0.4932 && zR < 0.4934 ) zS = static_cast<float>( 2.47 );
- else if (zR >= 0.4934 && zR < 0.4936 ) zS = static_cast<float>( 2.48 );
- else if (zR >= 0.4936 && zR < 0.4938 ) zS = static_cast<float>( 2.49 );
- else if (zR >= 0.4938 && zR < 0.494 ) zS = static_cast<float>( 2.5 );
- else if (zR >= 0.494 && zR < 0.4941 ) zS = static_cast<float>( 2.51 );
- else if (zR >= 0.4941 && zR < 0.4943 ) zS = static_cast<float>( 2.52 );
- else if (zR >= 0.4943 && zR < 0.4945 ) zS = static_cast<float>( 2.53 );
- else if (zR >= 0.4945 && zR < 0.4946 ) zS = static_cast<float>( 2.54 );
- else if (zR >= 0.4946 && zR < 0.4948 ) zS = static_cast<float>( 2.55 );
- else if (zR >= 0.4948 && zR < 0.4949 ) zS = static_cast<float>( 2.56 );
- else if (zR >= 0.4949 && zR < 0.4951 ) zS = static_cast<float>( 2.57 );
- else if (zR >= 0.4951 && zR < 0.4952 ) zS = static_cast<float>( 2.58 );
- else if (zR >= 0.4952 && zR < 0.4953 ) zS = static_cast<float>( 2.59 );
- else if (zR >= 0.4953 && zR < 0.4955 ) zS = static_cast<float>( 2.6 );
- else if (zR >= 0.4955 && zR < 0.4956 ) zS = static_cast<float>( 2.61 );
- else if (zR >= 0.4956 && zR < 0.4957 ) zS = static_cast<float>( 2.62 );
- else if (zR >= 0.4957 && zR < 0.4959 ) zS = static_cast<float>( 2.63 );
- else if (zR >= 0.4959 && zR < 0.496 ) zS = static_cast<float>( 2.64 );
- else if (zR >= 0.496 && zR < 0.4961 ) zS = static_cast<float>( 2.65 );
- else if (zR >= 0.4961 && zR < 0.4962 ) zS = static_cast<float>( 2.66 );
- else if (zR >= 0.4962 && zR < 0.4963 ) zS = static_cast<float>( 2.67 );
- else if (zR >= 0.4963 && zR < 0.4964 ) zS = static_cast<float>( 2.68 );
- else if (zR >= 0.4964 && zR < 0.4965 ) zS = static_cast<float>( 2.69 );
- else if (zR >= 0.4965 && zR < 0.4966 ) zS = static_cast<float>( 2.7 );
- else if (zR >= 0.4966 && zR < 0.4967 ) zS = static_cast<float>( 2.71 );
- else if (zR >= 0.4967 && zR < 0.4968 ) zS = static_cast<float>( 2.72 );
- else if (zR >= 0.4968 && zR < 0.4969 ) zS = static_cast<float>( 2.73 );
- else if (zR >= 0.4969 && zR < 0.497 ) zS = static_cast<float>( 2.74 );
- else if (zR >= 0.497 && zR < 0.4971 ) zS = static_cast<float>( 2.75 );
- else if (zR >= 0.4971 && zR < 0.4972 ) zS = static_cast<float>( 2.76 );
- else if (zR >= 0.4972 && zR < 0.4973 ) zS = static_cast<float>( 2.77 );
- else if (zR >= 0.4973 && zR < 0.4974 ) zS = static_cast<float>( 2.78 );
- else if (zR >= 0.4974 && zR < 0.4975 ) zS = static_cast<float>( 2.79 );
- else if (zR >= 0.4975 && zR < 0.4976 ) zS = static_cast<float>( 2.81 );
- else if (zR >= 0.4976 && zR < 0.4977 ) zS = static_cast<float>( 2.82 );
- else if (zR >= 0.4977 && zR < 0.4978 ) zS = static_cast<float>( 2.83 );
- else if (zR >= 0.4978 && zR < 0.4979 ) zS = static_cast<float>( 2.85 );
- else if (zR >= 0.4979 && zR < 0.498 ) zS = static_cast<float>( 2.86 );
- else if (zR >= 0.498 && zR < 0.4981 ) zS = static_cast<float>( 2.88 );
- else if (zR >= 0.4981 && zR < 0.4982 ) zS = static_cast<float>( 2.89 );
- else if (zR >= 0.4982 && zR < 0.4983 ) zS = static_cast<float>( 2.91 );
- else if (zR >= 0.4983 && zR < 0.4984 ) zS = static_cast<float>( 2.93 );
- else if (zR >= 0.4984 && zR < 0.4985 ) zS = static_cast<float>( 2.94 );
- else if (zR >= 0.4985 && zR < 0.4986 ) zS = static_cast<float>( 2.96 );
- else if (zR >= 0.4986 && zR < 0.4987 ) zS = static_cast<float>( 2.98 );
- else if (zR >= 0.4987 && zR < 0.4988 ) zS = static_cast<float>( 3 );
- else if (zR >= 0.4988 && zR < 0.4989 ) zS = static_cast<float>( 3.03 );
- else if (zR >= 0.4989 && zR < 0.499 ) zS = static_cast<float>( 3.05 );
- else if (zR >= 0.499 && zR < 0.4991 ) zS = static_cast<float>( 3.08 );
- else if (zR >= 0.4991 && zR < 0.4992 ) zS = static_cast<float>( 3.11 );
- else if (zR >= 0.4992 && zR < 0.4993 ) zS = static_cast<float>( 3.15 );
- else if (zR >= 0.4993 && zR < 0.4994 ) zS = static_cast<float>( 3.18 );
- else if (zR >= 0.4994 && zR < 0.4995 ) zS = static_cast<float>( 3.22 );
- else if (zR >= 0.4995 && zR < 0.4996 ) zS = static_cast<float>( 3.27 );
- else if (zR >= 0.4996 && zR < 0.4997 ) zS = static_cast<float>( 3.33 );
- else if (zR >= 0.4997 && zR < 0.4998 ) zS = static_cast<float>( 3.39 );
- else if (zR >= 0.4998 && zR < 0.4999 ) zS = static_cast<float>( 3.49 );
- else zS = static_cast<float>( 3.7 );
- }
- zS *= signFlip;
- return (zS);
- }
- float corrAnalysis(long double arr0[], long double arr1[], int& n)
- {
- long double mean1, mean0, sum = 0, avgSum;
- float r, sD1, sD0, sdProd, meanProd;
- mean0 = findMean(arr0, n);
- sD0 = findStdDev(arr0, n);
- mean1 = findMean(arr1, n);
- sD1 = findStdDev(arr1, n);
- sdProd = sD1 * sD0;
- meanProd = mean1 * mean0;
- for (int i = 0; i < n; i++) sum += (arr0[i] * arr1[i]);
- avgSum = sum/n;
- r = static_cast<float>((avgSum - meanProd)/sdProd);
- return r;
- }
- void corrSignificance(float pR, int& n)
- {
- float aPr = abs(pR);
- int df;
- if (n > 102) df = 100; else df = n-2;
- bool p50 = false, p20 = false, p10 = false, p05 = false, p02 = false, p01 = false;
- switch(df)
- {
- case 1:
- if (aPr >= 0.7071) p50 = true;
- if (aPr >= 0.9511) p20 = true;
- if (aPr >= 0.9877) p10 = true;
- if (aPr >= 0.9969) p05 = true;
- if (aPr >= 0.9995) p02 = true;
- if (aPr >= 0.9999) p01 = true;
- break;
- case 2:
- if (aPr >= 0.5000) p50 = true;
- if (aPr >= 0.8000) p20 = true;
- if (aPr >= 0.9000) p10 = true;
- if (aPr >= 0.9500) p05 = true;
- if (aPr >= 0.9800) p02 = true;
- if (aPr >= 0.9900) p01 = true;
- break;
- case 3:
- if (aPr >= 0.4040) p50 = true;
- if (aPr >= 0.6870) p20 = true;
- if (aPr >= 0.8054) p10 = true;
- if (aPr >= 0.8783) p05 = true;
- if (aPr >= 0.9343) p02 = true;
- if (aPr >= 0.9587) p01 = true;
- break;
- case 4:
- if (aPr >= 0.3473) p50 = true;
- if (aPr >= 0.6084) p20 = true;
- if (aPr >= 0.7293) p10 = true;
- if (aPr >= 0.8114) p05 = true;
- if (aPr >= 0.8822) p02 = true;
- if (aPr >= 0.9172) p01 = true;
- break;
- case 5:
- if (aPr >= 0.3091) p50 = true;
- if (aPr >= 0.5509) p20 = true;
- if (aPr >= 0.6694) p10 = true;
- if (aPr >= 0.7545) p05 = true;
- if (aPr >= 0.8329) p02 = true;
- if (aPr >= 0.8745) p01 = true;
- break;
- case 6:
- if (aPr >= 0.2811) p50 = true;
- if (aPr >= 0.5067) p20 = true;
- if (aPr >= 0.6215) p10 = true;
- if (aPr >= 0.7067) p05 = true;
- if (aPr >= 0.7887) p02 = true;
- if (aPr >= 0.8343) p01 = true;
- break;
- case 7:
- if (aPr >= 0.2596) p50 = true;
- if (aPr >= 0.4716) p20 = true;
- if (aPr >= 0.5822) p10 = true;
- if (aPr >= 0.6664) p05 = true;
- if (aPr >= 0.7498) p02 = true;
- if (aPr >= 0.7977) p01 = true;
- break;
- case 8:
- if (aPr >= 0.2423) p50 = true;
- if (aPr >= 0.4428) p20 = true;
- if (aPr >= 0.5494) p10 = true;
- if (aPr >= 0.6319) p05 = true;
- if (aPr >= 0.7155) p02 = true;
- if (aPr >= 0.7646) p01 = true;
- break;
- case 9:
- if (aPr >= 0.2281) p50 = true;
- if (aPr >= 0.4187) p20 = true;
- if (aPr >= 0.5214) p10 = true;
- if (aPr >= 0.6021) p05 = true;
- if (aPr >= 0.6851) p02 = true;
- if (aPr >= 0.7348) p01 = true;
- break;
- case 10:
- if (aPr >= 0.2161) p50 = true;
- if (aPr >= 0.3981) p20 = true;
- if (aPr >= 0.4973) p10 = true;
- if (aPr >= 0.5760) p05 = true;
- if (aPr >= 0.6581) p02 = true;
- if (aPr >= 0.7079) p01 = true;
- break;
- case 11:
- if (aPr >= 0.2058) p50 = true;
- if (aPr >= 0.3802) p20 = true;
- if (aPr >= 0.4762) p10 = true;
- if (aPr >= 0.5529) p05 = true;
- if (aPr >= 0.6339) p02 = true;
- if (aPr >= 0.6835) p01 = true;
- break;
- case 12:
- if (aPr >= 0.1968) p50 = true;
- if (aPr >= 0.3646) p20 = true;
- if (aPr >= 0.4575) p10 = true;
- if (aPr >= 0.5324) p05 = true;
- if (aPr >= 0.6120) p02 = true;
- if (aPr >= 0.6614) p01 = true;
- break;
- case 13:
- if (aPr >= 0.1890) p50 = true;
- if (aPr >= 0.3507) p20 = true;
- if (aPr >= 0.4409) p10 = true;
- if (aPr >= 0.5140) p05 = true;
- if (aPr >= 0.5923) p02 = true;
- if (aPr >= 0.6411) p01 = true;
- break;
- case 14:
- if (aPr >= 0.1820) p50 = true;
- if (aPr >= 0.3383) p20 = true;
- if (aPr >= 0.4259) p10 = true;
- if (aPr >= 0.4973) p05 = true;
- if (aPr >= 0.5742) p02 = true;
- if (aPr >= 0.6226) p01 = true;
- break;
- case 15:
- if (aPr >= 0.1757) p50 = true;
- if (aPr >= 0.3271) p20 = true;
- if (aPr >= 0.4124) p10 = true;
- if (aPr >= 0.4821) p05 = true;
- if (aPr >= 0.5577) p02 = true;
- if (aPr >= 0.6055) p01 = true;
- break;
- case 16:
- if (aPr >= 0.1700) p50 = true;
- if (aPr >= 0.3170) p20 = true;
- if (aPr >= 0.4000) p10 = true;
- if (aPr >= 0.4683) p05 = true;
- if (aPr >= 0.5425) p02 = true;
- if (aPr >= 0.5897) p01 = true;
- break;
- case 17:
- if (aPr >= 0.1649) p50 = true;
- if (aPr >= 0.3077) p20 = true;
- if (aPr >= 0.3887) p10 = true;
- if (aPr >= 0.4555) p05 = true;
- if (aPr >= 0.5285) p02 = true;
- if (aPr >= 0.5751) p01 = true;
- break;
- case 18:
- if (aPr >= 0.1602) p50 = true;
- if (aPr >= 0.2992) p20 = true;
- if (aPr >= 0.3783) p10 = true;
- if (aPr >= 0.4438) p05 = true;
- if (aPr >= 0.5155) p02 = true;
- if (aPr >= 0.5614) p01 = true;
- break;
- case 19:
- if (aPr >= 0.1558) p50 = true;
- if (aPr >= 0.2914) p20 = true;
- if (aPr >= 0.3687) p10 = true;
- if (aPr >= 0.4329) p05 = true;
- if (aPr >= 0.5034) p02 = true;
- if (aPr >= 0.5487) p01 = true;
- break;
- case 20:
- if (aPr >= 0.1518) p50 = true;
- if (aPr >= 0.2841) p20 = true;
- if (aPr >= 0.3598) p10 = true;
- if (aPr >= 0.4227) p05 = true;
- if (aPr >= 0.4921) p02 = true;
- if (aPr >= 0.5368) p01 = true;
- break;
- case 21:
- if (aPr >= 0.1481) p50 = true;
- if (aPr >= 0.2774) p20 = true;
- if (aPr >= 0.3515) p10 = true;
- if (aPr >= 0.4132) p05 = true;
- if (aPr >= 0.4815) p02 = true;
- if (aPr >= 0.5256) p01 = true;
- break;
- case 22:
- if (aPr >= 0.1447) p50 = true;
- if (aPr >= 0.2711) p20 = true;
- if (aPr >= 0.3438) p10 = true;
- if (aPr >= 0.4044) p05 = true;
- if (aPr >= 0.4716) p02 = true;
- if (aPr >= 0.5151) p01 = true;
- break;
- case 23:
- if (aPr >= 0.1415) p50 = true;
- if (aPr >= 0.2653) p20 = true;
- if (aPr >= 0.3365) p10 = true;
- if (aPr >= 0.3961) p05 = true;
- if (aPr >= 0.4622) p02 = true;
- if (aPr >= 0.5052) p01 = true;
- break;
- case 24:
- if (aPr >= 0.1384) p50 = true;
- if (aPr >= 0.2598) p20 = true;
- if (aPr >= 0.3297) p10 = true;
- if (aPr >= 0.3882) p05 = true;
- if (aPr >= 0.4534) p02 = true;
- if (aPr >= 0.4958) p01 = true;
- break;
- case 25:
- if (aPr >= 0.1356) p50 = true;
- if (aPr >= 0.2546) p20 = true;
- if (aPr >= 0.3233) p10 = true;
- if (aPr >= 0.3809) p05 = true;
- if (aPr >= 0.4451) p02 = true;
- if (aPr >= 0.4869) p01 = true;
- break;
- case 26:
- if (aPr >= 0.1330) p50 = true;
- if (aPr >= 0.2497) p20 = true;
- if (aPr >= 0.3172) p10 = true;
- if (aPr >= 0.3739) p05 = true;
- if (aPr >= 0.4372) p02 = true;
- if (aPr >= 0.4785) p01 = true;
- break;
- case 27:
- if (aPr >= 0.1305) p50 = true;
- if (aPr >= 0.2451) p20 = true;
- if (aPr >= 0.3115) p10 = true;
- if (aPr >= 0.3673) p05 = true;
- if (aPr >= 0.4297) p02 = true;
- if (aPr >= 0.4705) p01 = true;
- break;
- case 28:
- if (aPr >= 0.1281) p50 = true;
- if (aPr >= 0.2407) p20 = true;
- if (aPr >= 0.3061) p10 = true;
- if (aPr >= 0.3610) p05 = true;
- if (aPr >= 0.4226) p02 = true;
- if (aPr >= 0.4629) p01 = true;
- break;
- case 29:
- if (aPr >= 0.1258) p50 = true;
- if (aPr >= 0.2366) p20 = true;
- if (aPr >= 0.3009) p10 = true;
- if (aPr >= 0.3550) p05 = true;
- if (aPr >= 0.4158) p02 = true;
- if (aPr >= 0.4556) p01 = true;
- break;
- case 30:
- if (aPr >= 0.1237) p50 = true;
- if (aPr >= 0.2327) p20 = true;
- if (aPr >= 0.2960) p10 = true;
- if (aPr >= 0.3494) p05 = true;
- if (aPr >= 0.4093) p02 = true;
- if (aPr >= 0.4487) p01 = true;
- break;
- case 31:
- if (aPr >= 0.1217) p50 = true;
- if (aPr >= 0.2289) p20 = true;
- if (aPr >= 0.2913) p10 = true;
- if (aPr >= 0.3440) p05 = true;
- if (aPr >= 0.4032) p02 = true;
- if (aPr >= 0.4421) p01 = true;
- break;
- case 32:
- if (aPr >= 0.1197) p50 = true;
- if (aPr >= 0.2254) p20 = true;
- if (aPr >= 0.2869) p10 = true;
- if (aPr >= 0.3388) p05 = true;
- if (aPr >= 0.3972) p02 = true;
- if (aPr >= 0.4357) p01 = true;
- break;
- case 33:
- if (aPr >= 0.1179) p50 = true;
- if (aPr >= 0.2220) p20 = true;
- if (aPr >= 0.2826) p10 = true;
- if (aPr >= 0.3338) p05 = true;
- if (aPr >= 0.3916) p02 = true;
- if (aPr >= 0.4296) p01 = true;
- break;
- case 34:
- if (aPr >= 0.1161) p50 = true;
- if (aPr >= 0.2187) p20 = true;
- if (aPr >= 0.2785) p10 = true;
- if (aPr >= 0.3291) p05 = true;
- if (aPr >= 0.3862) p02 = true;
- if (aPr >= 0.4238) p01 = true;
- break;
- case 35:
- if (aPr >= 0.1144) p50 = true;
- if (aPr >= 0.2156) p20 = true;
- if (aPr >= 0.2746) p10 = true;
- if (aPr >= 0.3246) p05 = true;
- if (aPr >= 0.3810) p02 = true;
- if (aPr >= 0.4182) p01 = true;
- break;
- case 36:
- if (aPr >= 0.1128) p50 = true;
- if (aPr >= 0.2126) p20 = true;
- if (aPr >= 0.2709) p10 = true;
- if (aPr >= 0.3202) p05 = true;
- if (aPr >= 0.3760) p02 = true;
- if (aPr >= 0.4128) p01 = true;
- break;
- case 37:
- if (aPr >= 0.1113) p50 = true;
- if (aPr >= 0.2097) p20 = true;
- if (aPr >= 0.2673) p10 = true;
- if (aPr >= 0.3160) p05 = true;
- if (aPr >= 0.3712) p02 = true;
- if (aPr >= 0.4076) p01 = true;
- break;
- case 38:
- if (aPr >= 0.1098) p50 = true;
- if (aPr >= 0.2070) p20 = true;
- if (aPr >= 0.2638) p10 = true;
- if (aPr >= 0.3120) p05 = true;
- if (aPr >= 0.3665) p02 = true;
- if (aPr >= 0.4026) p01 = true;
- break;
- case 39:
- if (aPr >= 0.1084) p50 = true;
- if (aPr >= 0.2043) p20 = true;
- if (aPr >= 0.2605) p10 = true;
- if (aPr >= 0.3081) p05 = true;
- if (aPr >= 0.3621) p02 = true;
- if (aPr >= 0.3978) p01 = true;
- break;
- case 40:
- if (aPr >= 0.1070) p50 = true;
- if (aPr >= 0.2018) p20 = true;
- if (aPr >= 0.2573) p10 = true;
- if (aPr >= 0.3044) p05 = true;
- if (aPr >= 0.3578) p02 = true;
- if (aPr >= 0.3932) p01 = true;
- break;
- case 41:
- if (aPr >= 0.1057) p50 = true;
- if (aPr >= 0.1993) p20 = true;
- if (aPr >= 0.2542) p10 = true;
- if (aPr >= 0.3008) p05 = true;
- if (aPr >= 0.3536) p02 = true;
- if (aPr >= 0.3887) p01 = true;
- break;
- case 42:
- if (aPr >= 0.1044) p50 = true;
- if (aPr >= 0.1970) p20 = true;
- if (aPr >= 0.2512) p10 = true;
- if (aPr >= 0.2973) p05 = true;
- if (aPr >= 0.3496) p02 = true;
- if (aPr >= 0.3843) p01 = true;
- break;
- case 43:
- if (aPr >= 0.1032) p50 = true;
- if (aPr >= 0.1947) p20 = true;
- if (aPr >= 0.2483) p10 = true;
- if (aPr >= 0.2940) p05 = true;
- if (aPr >= 0.3457) p02 = true;
- if (aPr >= 0.3801) p01 = true;
- break;
- case 44:
- if (aPr >= 0.1020) p50 = true;
- if (aPr >= 0.1925) p20 = true;
- if (aPr >= 0.2455) p10 = true;
- if (aPr >= 0.2907) p05 = true;
- if (aPr >= 0.3420) p02 = true;
- if (aPr >= 0.3761) p01 = true;
- break;
- case 45:
- if (aPr >= 0.1008) p50 = true;
- if (aPr >= 0.1903) p20 = true;
- if (aPr >= 0.2429) p10 = true;
- if (aPr >= 0.2876) p05 = true;
- if (aPr >= 0.3384) p02 = true;
- if (aPr >= 0.3721) p01 = true;
- break;
- case 46:
- if (aPr >= 0.0997) p50 = true;
- if (aPr >= 0.1883) p20 = true;
- if (aPr >= 0.2403) p10 = true;
- if (aPr >= 0.2845) p05 = true;
- if (aPr >= 0.3348) p02 = true;
- if (aPr >= 0.3683) p01 = true;
- break;
- case 47:
- if (aPr >= 0.0987) p50 = true;
- if (aPr >= 0.1863) p20 = true;
- if (aPr >= 0.2377) p10 = true;
- if (aPr >= 0.2816) p05 = true;
- if (aPr >= 0.3314) p02 = true;
- if (aPr >= 0.3646) p01 = true;
- break;
- case 48:
- if (aPr >= 0.0976) p50 = true;
- if (aPr >= 0.1843) p20 = true;
- if (aPr >= 0.2353) p10 = true;
- if (aPr >= 0.2787) p05 = true;
- if (aPr >= 0.3281) p02 = true;
- if (aPr >= 0.3610) p01 = true;
- break;
- case 49:
- if (aPr >= 0.0966) p50 = true;
- if (aPr >= 0.1825) p20 = true;
- if (aPr >= 0.2329) p10 = true;
- if (aPr >= 0.2759) p05 = true;
- if (aPr >= 0.3249) p02 = true;
- if (aPr >= 0.3575) p01 = true;
- break;
- case 50:
- if (aPr >= 0.0956) p50 = true;
- if (aPr >= 0.1806) p20 = true;
- if (aPr >= 0.2306) p10 = true;
- if (aPr >= 0.2732) p05 = true;
- if (aPr >= 0.3218) p02 = true;
- if (aPr >= 0.3542) p01 = true;
- break;
- case 51:
- if (aPr >= 0.0947) p50 = true;
- if (aPr >= 0.1789) p20 = true;
- if (aPr >= 0.2284) p10 = true;
- if (aPr >= 0.2706) p05 = true;
- if (aPr >= 0.3188) p02 = true;
- if (aPr >= 0.3509) p01 = true;
- break;
- case 52:
- if (aPr >= 0.0938) p50 = true;
- if (aPr >= 0.1772) p20 = true;
- if (aPr >= 0.2262) p10 = true;
- if (aPr >= 0.2681) p05 = true;
- if (aPr >= 0.3158) p02 = true;
- if (aPr >= 0.3477) p01 = true;
- break;
- case 53:
- if (aPr >= 0.0929) p50 = true;
- if (aPr >= 0.1755) p20 = true;
- if (aPr >= 0.2241) p10 = true;
- if (aPr >= 0.2656) p05 = true;
- if (aPr >= 0.3129) p02 = true;
- if (aPr >= 0.3445) p01 = true;
- break;
- case 54:
- if (aPr >= 0.0920) p50 = true;
- if (aPr >= 0.1739) p20 = true;
- if (aPr >= 0.2221) p10 = true;
- if (aPr >= 0.2632) p05 = true;
- if (aPr >= 0.3102) p02 = true;
- if (aPr >= 0.3415) p01 = true;
- break;
- case 55:
- if (aPr >= 0.0912) p50 = true;
- if (aPr >= 0.1723) p20 = true;
- if (aPr >= 0.2201) p10 = true;
- if (aPr >= 0.2609) p05 = true;
- if (aPr >= 0.3074) p02 = true;
- if (aPr >= 0.3385) p01 = true;
- break;
- case 56:
- if (aPr >= 0.0904) p50 = true;
- if (aPr >= 0.1708) p20 = true;
- if (aPr >= 0.2181) p10 = true;
- if (aPr >= 0.2586) p05 = true;
- if (aPr >= 0.3048) p02 = true;
- if (aPr >= 0.3357) p01 = true;
- break;
- case 57:
- if (aPr >= 0.0896) p50 = true;
- if (aPr >= 0.1693) p20 = true;
- if (aPr >= 0.2162) p10 = true;
- if (aPr >= 0.2564) p05 = true;
- if (aPr >= 0.3022) p02 = true;
- if (aPr >= 0.3328) p01 = true;
- break;
- case 58:
- if (aPr >= 0.0888) p50 = true;
- if (aPr >= 0.1678) p20 = true;
- if (aPr >= 0.2144) p10 = true;
- if (aPr >= 0.2542) p05 = true;
- if (aPr >= 0.2997) p02 = true;
- if (aPr >= 0.3301) p01 = true;
- break;
- case 59:
- if (aPr >= 0.0880) p50 = true;
- if (aPr >= 0.1664) p20 = true;
- if (aPr >= 0.2126) p10 = true;
- if (aPr >= 0.2521) p05 = true;
- if (aPr >= 0.2972) p02 = true;
- if (aPr >= 0.3274) p01 = true;
- break;
- case 60:
- if (aPr >= 0.0873) p50 = true;
- if (aPr >= 0.1650) p20 = true;
- if (aPr >= 0.2108) p10 = true;
- if (aPr >= 0.2500) p05 = true;
- if (aPr >= 0.2948) p02 = true;
- if (aPr >= 0.3248) p01 = true;
- break;
- case 61:
- if (aPr >= 0.0866) p50 = true;
- if (aPr >= 0.1636) p20 = true;
- if (aPr >= 0.2091) p10 = true;
- if (aPr >= 0.2480) p05 = true;
- if (aPr >= 0.2925) p02 = true;
- if (aPr >= 0.3223) p01 = true;
- break;
- case 62:
- if (aPr >= 0.0858) p50 = true;
- if (aPr >= 0.1623) p20 = true;
- if (aPr >= 0.2075) p10 = true;
- if (aPr >= 0.2461) p05 = true;
- if (aPr >= 0.2902) p02 = true;
- if (aPr >= 0.3198) p01 = true;
- break;
- case 63:
- if (aPr >= 0.0852) p50 = true;
- if (aPr >= 0.1610) p20 = true;
- if (aPr >= 0.2058) p10 = true;
- if (aPr >= 0.2441) p05 = true;
- if (aPr >= 0.2880) p02 = true;
- if (aPr >= 0.3173) p01 = true;
- break;
- case 64:
- if (aPr >= 0.0845) p50 = true;
- if (aPr >= 0.1598) p20 = true;
- if (aPr >= 0.2042) p10 = true;
- if (aPr >= 0.2423) p05 = true;
- if (aPr >= 0.2858) p02 = true;
- if (aPr >= 0.3150) p01 = true;
- break;
- case 65:
- if (aPr >= 0.0838) p50 = true;
- if (aPr >= 0.1586) p20 = true;
- if (aPr >= 0.2027) p10 = true;
- if (aPr >= 0.2404) p05 = true;
- if (aPr >= 0.2837) p02 = true;
- if (aPr >= 0.3126) p01 = true;
- break;
- case 66:
- if (aPr >= 0.0832) p50 = true;
- if (aPr >= 0.1574) p20 = true;
- if (aPr >= 0.2012) p10 = true;
- if (aPr >= 0.2387) p05 = true;
- if (aPr >= 0.2816) p02 = true;
- if (aPr >= 0.3104) p01 = true;
- break;
- case 67:
- if (aPr >= 0.0826) p50 = true;
- if (aPr >= 0.1562) p20 = true;
- if (aPr >= 0.1997) p10 = true;
- if (aPr >= 0.2369) p05 = true;
- if (aPr >= 0.2796) p02 = true;
- if (aPr >= 0.3081) p01 = true;
- break;
- case 68:
- if (aPr >= 0.0820) p50 = true;
- if (aPr >= 0.1550) p20 = true;
- if (aPr >= 0.1982) p10 = true;
- if (aPr >= 0.2352) p05 = true;
- if (aPr >= 0.2776) p02 = true;
- if (aPr >= 0.3060) p01 = true;
- break;
- case 69:
- if (aPr >= 0.0814) p50 = true;
- if (aPr >= 0.1539) p20 = true;
- if (aPr >= 0.1968) p10 = true;
- if (aPr >= 0.2335) p05 = true;
- if (aPr >= 0.2756) p02 = true;
- if (aPr >= 0.3038) p01 = true;
- break;
- case 70:
- if (aPr >= 0.0808) p50 = true;
- if (aPr >= 0.1528) p20 = true;
- if (aPr >= 0.1954) p10 = true;
- if (aPr >= 0.2319) p05 = true;
- if (aPr >= 0.2737) p02 = true;
- if (aPr >= 0.3017) p01 = true;
- break;
- case 71:
- if (aPr >= 0.0802) p50 = true;
- if (aPr >= 0.1517) p20 = true;
- if (aPr >= 0.1940) p10 = true;
- if (aPr >= 0.2303) p05 = true;
- if (aPr >= 0.2718) p02 = true;
- if (aPr >= 0.2997) p01 = true;
- break;
- case 72:
- if (aPr >= 0.0796) p50 = true;
- if (aPr >= 0.1507) p20 = true;
- if (aPr >= 0.1927) p10 = true;
- if (aPr >= 0.2287) p05 = true;
- if (aPr >= 0.2700) p02 = true;
- if (aPr >= 0.2977) p01 = true;
- break;
- case 73:
- if (aPr >= 0.0791) p50 = true;
- if (aPr >= 0.1497) p20 = true;
- if (aPr >= 0.1914) p10 = true;
- if (aPr >= 0.2272) p05 = true;
- if (aPr >= 0.2682) p02 = true;
- if (aPr >= 0.2957) p01 = true;
- break;
- case 74:
- if (aPr >= 0.0786) p50 = true;
- if (aPr >= 0.1486) p20 = true;
- if (aPr >= 0.1901) p10 = true;
- if (aPr >= 0.2257) p05 = true;
- if (aPr >= 0.2664) p02 = true;
- if (aPr >= 0.2938) p01 = true;
- break;
- case 75:
- if (aPr >= 0.0780) p50 = true;
- if (aPr >= 0.1477) p20 = true;
- if (aPr >= 0.1888) p10 = true;
- if (aPr >= 0.2242) p05 = true;
- if (aPr >= 0.2647) p02 = true;
- if (aPr >= 0.2919) p01 = true;
- break;
- case 76:
- if (aPr >= 0.0775) p50 = true;
- if (aPr >= 0.1467) p20 = true;
- if (aPr >= 0.1876) p10 = true;
- if (aPr >= 0.2227) p05 = true;
- if (aPr >= 0.2630) p02 = true;
- if (aPr >= 0.2900) p01 = true;
- break;
- case 77:
- if (aPr >= 0.0770) p50 = true;
- if (aPr >= 0.1457) p20 = true;
- if (aPr >= 0.1864) p10 = true;
- if (aPr >= 0.2213) p05 = true;
- if (aPr >= 0.2613) p02 = true;
- if (aPr >= 0.2882) p01 = true;
- break;
- case 78:
- if (aPr >= 0.0765) p50 = true;
- if (aPr >= 0.1448) p20 = true;
- if (aPr >= 0.1852) p10 = true;
- if (aPr >= 0.2199) p05 = true;
- if (aPr >= 0.2597) p02 = true;
- if (aPr >= 0.2864) p01 = true;
- break;
- case 79:
- if (aPr >= 0.0760) p50 = true;
- if (aPr >= 0.1439) p20 = true;
- if (aPr >= 0.1841) p10 = true;
- if (aPr >= 0.2185) p05 = true;
- if (aPr >= 0.2581) p02 = true;
- if (aPr >= 0.2847) p01 = true;
- break;
- case 80:
- if (aPr >= 0.0755) p50 = true;
- if (aPr >= 0.1430) p20 = true;
- if (aPr >= 0.1829) p10 = true;
- if (aPr >= 0.2172) p05 = true;
- if (aPr >= 0.2565) p02 = true;
- if (aPr >= 0.2830) p01 = true;
- break;
- case 81:
- if (aPr >= 0.0751) p50 = true;
- if (aPr >= 0.1421) p20 = true;
- if (aPr >= 0.1818) p10 = true;
- if (aPr >= 0.2159) p05 = true;
- if (aPr >= 0.2550) p02 = true;
- if (aPr >= 0.2813) p01 = true;
- break;
- case 82:
- if (aPr >= 0.0746) p50 = true;
- if (aPr >= 0.1412) p20 = true;
- if (aPr >= 0.1807) p10 = true;
- if (aPr >= 0.2146) p05 = true;
- if (aPr >= 0.2535) p02 = true;
- if (aPr >= 0.2796) p01 = true;
- break;
- case 83:
- if (aPr >= 0.0742) p50 = true;
- if (aPr >= 0.1404) p20 = true;
- if (aPr >= 0.1796) p10 = true;
- if (aPr >= 0.2133) p05 = true;
- if (aPr >= 0.2520) p02 = true;
- if (aPr >= 0.2780) p01 = true;
- break;
- case 84:
- if (aPr >= 0.0737) p50 = true;
- if (aPr >= 0.1396) p20 = true;
- if (aPr >= 0.1786) p10 = true;
- if (aPr >= 0.2120) p05 = true;
- if (aPr >= 0.2505) p02 = true;
- if (aPr >= 0.2764) p01 = true;
- break;
- case 85:
- if (aPr >= 0.0733) p50 = true;
- if (aPr >= 0.1387) p20 = true;
- if (aPr >= 0.1775) p10 = true;
- if (aPr >= 0.2108) p05 = true;
- if (aPr >= 0.2491) p02 = true;
- if (aPr >= 0.2748) p01 = true;
- break;
- case 86:
- if (aPr >= 0.0728) p50 = true;
- if (aPr >= 0.1379) p20 = true;
- if (aPr >= 0.1765) p10 = true;
- if (aPr >= 0.2096) p05 = true;
- if (aPr >= 0.2477) p02 = true;
- if (aPr >= 0.2732) p01 = true;
- break;
- case 87:
- if (aPr >= 0.0724) p50 = true;
- if (aPr >= 0.1371) p20 = true;
- if (aPr >= 0.1755) p10 = true;
- if (aPr >= 0.2084) p05 = true;
- if (aPr >= 0.2463) p02 = true;
- if (aPr >= 0.2717) p01 = true;
- break;
- case 88:
- if (aPr >= 0.0720) p50 = true;
- if (aPr >= 0.1364) p20 = true;
- if (aPr >= 0.1745) p10 = true;
- if (aPr >= 0.2072) p05 = true;
- if (aPr >= 0.2449) p02 = true;
- if (aPr >= 0.2702) p01 = true;
- break;
- case 89:
- if (aPr >= 0.0716) p50 = true;
- if (aPr >= 0.1356) p20 = true;
- if (aPr >= 0.1735) p10 = true;
- if (aPr >= 0.2061) p05 = true;
- if (aPr >= 0.2435) p02 = true;
- if (aPr >= 0.2687) p01 = true;
- break;
- case 90:
- if (aPr >= 0.0712) p50 = true;
- if (aPr >= 0.1348) p20 = true;
- if (aPr >= 0.1726) p10 = true;
- if (aPr >= 0.2050) p05 = true;
- if (aPr >= 0.2422) p02 = true;
- if (aPr >= 0.2673) p01 = true;
- break;
- case 91:
- if (aPr >= 0.0708) p50 = true;
- if (aPr >= 0.1341) p20 = true;
- if (aPr >= 0.1716) p10 = true;
- if (aPr >= 0.2039) p05 = true;
- if (aPr >= 0.2409) p02 = true;
- if (aPr >= 0.2659) p01 = true;
- break;
- case 92:
- if (aPr >= 0.0704) p50 = true;
- if (aPr >= 0.1334) p20 = true;
- if (aPr >= 0.1707) p10 = true;
- if (aPr >= 0.2028) p05 = true;
- if (aPr >= 0.2396) p02 = true;
- if (aPr >= 0.2645) p01 = true;
- break;
- case 93:
- if (aPr >= 0.0700) p50 = true;
- if (aPr >= 0.1327) p20 = true;
- if (aPr >= 0.1698) p10 = true;
- if (aPr >= 0.2017) p05 = true;
- if (aPr >= 0.2384) p02 = true;
- if (aPr >= 0.2631) p01 = true;
- break;
- case 94:
- if (aPr >= 0.0697) p50 = true;
- if (aPr >= 0.1320) p20 = true;
- if (aPr >= 0.1689) p10 = true;
- if (aPr >= 0.2006) p05 = true;
- if (aPr >= 0.2371) p02 = true;
- if (aPr >= 0.2617) p01 = true;
- break;
- case 95:
- if (aPr >= 0.0693) p50 = true;
- if (aPr >= 0.1313) p20 = true;
- if (aPr >= 0.1680) p10 = true;
- if (aPr >= 0.1996) p05 = true;
- if (aPr >= 0.2359) p02 = true;
- if (aPr >= 0.2604) p01 = true;
- break;
- case 96:
- if (aPr >= 0.0689) p50 = true;
- if (aPr >= 0.1306) p20 = true;
- if (aPr >= 0.1671) p10 = true;
- if (aPr >= 0.1986) p05 = true;
- if (aPr >= 0.2347) p02 = true;
- if (aPr >= 0.2591) p01 = true;
- break;
- case 97:
- if (aPr >= 0.0686) p50 = true;
- if (aPr >= 0.1299) p20 = true;
- if (aPr >= 0.1663) p10 = true;
- if (aPr >= 0.1975) p05 = true;
- if (aPr >= 0.2335) p02 = true;
- if (aPr >= 0.2578) p01 = true;
- break;
- case 98:
- if (aPr >= 0.0682) p50 = true;
- if (aPr >= 0.1292) p20 = true;
- if (aPr >= 0.1654) p10 = true;
- if (aPr >= 0.1966) p05 = true;
- if (aPr >= 0.2324) p02 = true;
- if (aPr >= 0.2565) p01 = true;
- break;
- case 99:
- if (aPr >= 0.0679) p50 = true;
- if (aPr >= 0.1286) p20 = true;
- if (aPr >= 0.1646) p10 = true;
- if (aPr >= 0.1956) p05 = true;
- if (aPr >= 0.2312) p02 = true;
- if (aPr >= 0.2552) p01 = true;
- break;
- case 100:
- if (aPr >= 0.0675) p50 = true;
- if (aPr >= 0.1279) p20 = true;
- if (aPr >= 0.1638) p10 = true;
- if (aPr >= 0.1946) p05 = true;
- if (aPr >= 0.2301) p02 = true;
- if (aPr >= 0.2540) p01 = true;
- }
- cout << "For n = " << n << " samples, a DF of " << df << " was used.\n\n"
- << " +-------------+-----+-----+-----+-----+-----+-----+\n"
- << " | Alpha Error | .5 | .2 | .1 | .05 | .02 | .01 |\n"
- << " | Percentage | 50% | 20% | 90% | 95% | 98% | 99% |\n"
- << " | Significant |";
- if (p50) cout << " Yes |"; else cout << " No |";
- if (p20) cout << " Yes |"; else cout << " No |";
- if (p10) cout << " Yes |"; else cout << " No |";
- if (p05) cout << " Yes |"; else cout << " No |";
- if (p02) cout << " Yes |"; else cout << " No |";
- if (p01) cout << " Yes |"; else cout << " No |";
- cout << "\n +-------------+-----+-----+-----+-----+-----+-----+\n\n";
- if (p01) cout << " Or more formally: r(.01)(" << df << ") = " << pR << ", which can be excellent data.";
- else if (p02) cout << " Or more formally: r(.02)(" << df << ") = " << pR << ", which can be excellent data.";
- else if (p05) cout << " Or more formally: r(.05)(" << df << ") = " << pR << ", which can be very good data.";
- else if (p10) cout << " Or more formally: r(.10)(" << df << ") = " << pR << ", which is sometimes acceptable data.";
- else if (p20) cout << " Or more formally: r(.20)(" << df << ") = " << pR << ", which is NOT acceptable data.";
- else if (p50) cout << " Or more formally: r(.20)(" << df << ") = " << pR << ", which is effectivly useless data.";
- else cout << " Which means your data, no matter what the r, is not significant in any way.";
- cout << "\n\n";
- }
- bool loadStatsFile(long double arr[], int& numStats, string fileName)
- {
- ifstream filein;
- string temp;
- filein.open(fileName);
- if (filein.fail( )) return (false);
- else
- {
- cout << "Opened " << fileName << " and reading data.\n";
- numStats = 0;
- while(filein.good())
- {
- getline (filein, temp);
- arr[numStats] = atof(temp.c_str());
- numStats++;
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement