Trying to make a Cohen's D calculator but I'm having trouble with the logic

Hey guys,

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.

Thanks in advance guys!


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<iostream>
#include<iomanip>
using namespace 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;
}
Topic archived. No new replies allowed.