# Checking significance in differences between groups (gaps in income between genders and education levels)

I wonder if you could give me a hint on how to find out whether there is a significant difference in the income gap between genders and their education level. The picture below shows education levels (edu_level_old), means for women and men income (in Russian currency), and a gap in income measured by %.

I had no problem with finding out whether, for example, women with higher education earn less than men with higher education (done this by ttest). BUT what I would like to discover is whether this gap in earnings between different education levels (for example, a gap between those with higher education and secondary education) is statistically different. Is there a way I could do that? I have a feeling that it is rather simple and obvious for some but have no idea how to accomplish that. Your help is much appreciated!

There are three main types of t-test:

• An Independent Samples t-test (IS t-test) compares the means for two groups.
• A Paired sample t-test (PS t-test) compares means from the same group at different times, or occasions
• A One sample t-test (OS t-test) tests the mean of a single group against a known mean.

What type of the t-test you have used in your previous work? Was it R or Python? Because I see a problem, you have means but you don't have N. You cannot calculate the t-test without N.

Example in Python

N=100
a = np.random.randn(N) + 1
b = np.random.randn(N)

var_a = a.var(ddof=1)
var_b = b.var(ddof=1)

#std deviation
s = np.sqrt((var_a + var_b)/2)
s

## Calculate the t-statistics
t = (a.mean() - b.mean())/(s*np.sqrt(2/N))

## Compare with the critical t-value
#Degrees of freedom
df = 2*N - 2

#p-value after comparison with the t
p = 1 - stats.t.cdf(t,df=df)


It looks to me that the gap in income is useless information. Right?

I would like to discover is whether this gap in earnings between different education levels (for example, a gap between those with higher education and secondary education) is statistically different.

I think your problem is the gaps are not means so you cannot run t-tests on them. So the issue is that t-test isn't appropriate for percentages, nothing you can do about it.