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.