I'm trying to make a Cohen's D calculator but I can't think of a solid way to make it. I know all the formulas and what is needed, but I can't think of how I would compare the groups.
So far this is my code. I wanted to use an array to keep all of my information but I can't think of a way to use the information from, let's say, group 1 and group 3 to get the proper answer.
To find Cohen's D the formula is mean1 - mean3 / pooled standard deviation.
To find pooled standard deviation the formula is standard deviation 1 * sample size1 + sd3 * ss3 / total sample size.
I guess my question is how do I get it to skip a group so I get the cohen's d for 1 and 3, or 2 and 3.
#include<iostream>
#include<iomanip>
usingnamespace std;
int main()
{
// variable declaration
int groupNum = 0, sampleSize[10];
double mean[10], stanDev[10], PSD, CD;
// request user input for number of groups
cout << "How many sample groups do you wish to submit? ";
cin >> groupNum;
cout << endl;
// for loop to store mean, standard deviation, and sample size in arrays
for (int k = 1; k <= groupNum; k++)
{
cout << "Please enter the Mean for group " << k << ": ";
cin >> mean[k];
cout << "Please enter the Standard Deviation for group " << k << ": ";
cin >> stanDev[k];
cout << "Please enter the Sample Size for group " << k << ": ";
cin >> sampleSize[k];
cout << endl;
}
// for loop to print pooled standard deviation and cohen's d
for (int k = 1; k <= groupNum; k++)
{
}
system("pause");
return 0;
}