In: Statistics and Probability
Find the hypothesis testing on a two population mean. Need a T-test, interval and P-value focusing just on Gender not Rank or Enlisted
Description: A sample of 299 testing the Ethics scores for a sample of members of the U.S. Coast Guard by Gender (1=Male, 2=Female) and Rank (1=Officer, 2=Enlisted). Data simulated to match cell means and standard deviation. Variables/Columns Gender 8 Rank 16 Ethics Score 18-24
What is the T-test, P-value
Gender | Rank | Ethics Score |
1 | 1 | 34.99 |
1 | 1 | 25.08 |
1 | 1 | 40.5 |
1 | 1 | 50.96 |
1 | 1 | 50.17 |
1 | 1 | 55.59 |
1 | 1 | 15.9 |
1 | 1 | 35.66 |
1 | 1 | 49.12 |
1 | 1 | 27.02 |
1 | 1 | 31.04 |
1 | 1 | 20.9 |
1 | 1 | 19.31 |
1 | 1 | 28.12 |
1 | 1 | 30.19 |
1 | 1 | 16.57 |
1 | 1 | 32.27 |
1 | 1 | 33.93 |
1 | 1 | 39.4 |
1 | 1 | 34.33 |
1 | 1 | 34.72 |
1 | 1 | 34.28 |
1 | 1 | 51.63 |
1 | 1 | 37.16 |
1 | 1 | 36.14 |
1 | 1 | 32.83 |
1 | 1 | 58.01 |
1 | 1 | 46.8 |
1 | 1 | 62.1 |
1 | 1 | 31.39 |
1 | 1 | 54.86 |
1 | 1 | 21.69 |
1 | 1 | 43.49 |
1 | 1 | 47.17 |
1 | 1 | 57.47 |
1 | 1 | 37.17 |
1 | 1 | 32.72 |
1 | 1 | 44.87 |
1 | 1 | 34.17 |
1 | 1 | 45.71 |
1 | 1 | 23.4 |
1 | 1 | 29.44 |
1 | 1 | 22.61 |
1 | 1 | 34.35 |
1 | 1 | 37.7 |
1 | 1 | 38.31 |
1 | 1 | 34.76 |
1 | 1 | 60.27 |
1 | 1 | 20.37 |
1 | 1 | 30.57 |
1 | 1 | 11.91 |
1 | 1 | 52.7 |
1 | 1 | 25.06 |
1 | 1 | 31.41 |
1 | 1 | 45.71 |
1 | 1 | 42.76 |
1 | 1 | 46.89 |
1 | 1 | 44.07 |
1 | 1 | 24.13 |
1 | 1 | 26.72 |
1 | 1 | 45.06 |
1 | 1 | 41.3 |
1 | 1 | 28.51 |
1 | 1 | 35.59 |
1 | 1 | 39.36 |
1 | 1 | 43.68 |
1 | 1 | 39.43 |
1 | 1 | 28.8 |
1 | 1 | 57.13 |
1 | 1 | 42.97 |
1 | 1 | 38.76 |
1 | 1 | 46.44 |
1 | 2 | 41.49 |
1 | 2 | 30.32 |
1 | 2 | 9.76 |
1 | 2 | 16.29 |
1 | 2 | 22.78 |
1 | 2 | 19.21 |
1 | 2 | 19.83 |
1 | 2 | 21.22 |
1 | 2 | 27.41 |
1 | 2 | 46.69 |
1 | 2 | 25.71 |
1 | 2 | 51.09 |
1 | 2 | 16.11 |
1 | 2 | 32.9 |
1 | 2 | 40.03 |
1 | 2 | 9.01 |
1 | 2 | 47.07 |
1 | 2 | 18.81 |
1 | 2 | 28.48 |
1 | 2 | 32.25 |
1 | 2 | 20.25 |
1 | 2 | 37.06 |
1 | 2 | 47.62 |
1 | 2 | 39.58 |
1 | 2 | 24.29 |
1 | 2 | 31.79 |
1 | 2 | 14.03 |
1 | 2 | 51.64 |
1 | 2 | 39.43 |
1 | 2 | 46.54 |
1 | 2 | 23.72 |
1 | 2 | 19.5 |
1 | 2 | 27.35 |
1 | 2 | 25.31 |
1 | 2 | 21.26 |
1 | 2 | 30.49 |
1 | 2 | 25.82 |
1 | 2 | 25.14 |
1 | 2 | 27.38 |
1 | 2 | 27.74 |
1 | 2 | 25.34 |
1 | 2 | 18.52 |
1 | 2 | 18.51 |
1 | 2 | 35.55 |
1 | 2 | 4.17 |
1 | 2 | 32.86 |
1 | 2 | 52.03 |
1 | 2 | 29.7 |
1 | 2 | 29.27 |
1 | 2 | 26.3 |
1 | 2 | 30.35 |
1 | 2 | 54.5 |
1 | 2 | 38.7 |
1 | 2 | 27.87 |
1 | 2 | 28.96 |
1 | 2 | 44.55 |
1 | 2 | 29.46 |
1 | 2 | 13.49 |
1 | 2 | 33.35 |
1 | 2 | 25.79 |
1 | 2 | 27.06 |
1 | 2 | 27.83 |
1 | 2 | 56.99 |
1 | 2 | 12.88 |
1 | 2 | 40.45 |
1 | 2 | 30.99 |
1 | 2 | 34.32 |
1 | 2 | 34.57 |
1 | 2 | 23.69 |
1 | 2 | 34.88 |
1 | 2 | 41.82 |
1 | 2 | 22.45 |
1 | 2 | 17.25 |
1 | 2 | 29.13 |
1 | 2 | 25.67 |
1 | 2 | 46 |
1 | 2 | 20.65 |
1 | 2 | 20.63 |
1 | 2 | 32.3 |
1 | 2 | 20.7 |
1 | 2 | 35.26 |
1 | 2 | 35.17 |
1 | 2 | 24.07 |
1 | 2 | 14.98 |
1 | 2 | 22.27 |
1 | 2 | 29.35 |
1 | 2 | 22.69 |
1 | 2 | 34.08 |
1 | 2 | 21.61 |
1 | 2 | 37.95 |
1 | 2 | 50.55 |
1 | 2 | 46.64 |
1 | 2 | 33.08 |
1 | 2 | 23.7 |
1 | 2 | 25.69 |
1 | 2 | 42.52 |
1 | 2 | 36.72 |
1 | 2 | 40.76 |
1 | 2 | 28.96 |
1 | 2 | 34.32 |
1 | 2 | 4.95 |
1 | 2 | 30.17 |
1 | 2 | 13.47 |
1 | 2 | 32.71 |
1 | 2 | 25.85 |
1 | 2 | 30.63 |
1 | 2 | 24.89 |
1 | 2 | 38.75 |
1 | 2 | 36.59 |
1 | 2 | 18.54 |
1 | 2 | 29.61 |
1 | 2 | 34.33 |
1 | 2 | 29.53 |
1 | 2 | 42.06 |
1 | 2 | 38.01 |
1 | 2 | 63.03 |
1 | 2 | 10.09 |
1 | 2 | 28.79 |
1 | 2 | 50.52 |
1 | 2 | 23.15 |
1 | 2 | 42.44 |
1 | 2 | 38.36 |
1 | 2 | 14.12 |
1 | 2 | 31.46 |
1 | 2 | 36.61 |
1 | 2 | 14.47 |
1 | 2 | 40.16 |
1 | 2 | 50.32 |
1 | 2 | 22.14 |
1 | 2 | 11.52 |
1 | 2 | 31.8 |
1 | 2 | 40.58 |
1 | 2 | 38.17 |
1 | 2 | 32.47 |
1 | 2 | 40.28 |
1 | 2 | 19.41 |
1 | 2 | 19.98 |
1 | 2 | 46.61 |
1 | 2 | 27.03 |
1 | 2 | 31.51 |
1 | 2 | 47.92 |
1 | 2 | 37.88 |
1 | 2 | 2.42 |
1 | 2 | 17.08 |
1 | 2 | 24.97 |
1 | 2 | 36.62 |
1 | 2 | 42.98 |
1 | 2 | 25.6 |
1 | 2 | 49.35 |
1 | 2 | 27.88 |
1 | 2 | 37.98 |
1 | 2 | 40.09 |
1 | 2 | 31.17 |
1 | 2 | 23.82 |
1 | 2 | 33.84 |
1 | 2 | 8.52 |
1 | 2 | 18.78 |
1 | 2 | 44.13 |
1 | 2 | 32.04 |
1 | 2 | 30.85 |
1 | 2 | 18.06 |
1 | 2 | 45.27 |
1 | 2 | 40.41 |
1 | 2 | 42.65 |
1 | 2 | 39.44 |
1 | 2 | 23.53 |
1 | 2 | 28.58 |
1 | 2 | 27.76 |
1 | 2 | 29.86 |
1 | 2 | 29.56 |
1 | 2 | 37.8 |
1 | 2 | 38.5 |
1 | 2 | 27.33 |
1 | 2 | 43.38 |
1 | 2 | 48.8 |
1 | 2 | 33.56 |
1 | 2 | 26.08 |
1 | 2 | 7.9 |
1 | 2 | 29.7 |
1 | 2 | 38.5 |
2 | 1 | 52.77 |
2 | 1 | 50.34 |
2 | 1 | 47.2 |
2 | 1 | 38.45 |
2 | 1 | 47.77 |
2 | 1 | 60.11 |
2 | 1 | 28.45 |
2 | 1 | 37.19 |
2 | 1 | 51.65 |
2 | 1 | 53.07 |
2 | 1 | 44.74 |
2 | 1 | 28.43 |
2 | 1 | 43.63 |
2 | 1 | 35.05 |
2 | 1 | 27.65 |
2 | 2 | 47.23 |
2 | 2 | 27.8 |
2 | 2 | 30.46 |
2 | 2 | 12.69 |
2 | 2 | 43.78 |
2 | 2 | 39.35 |
2 | 2 | 28.33 |
2 | 2 | 65.22 |
2 | 2 | 42.34 |
2 | 2 | 13.75 |
2 | 2 | 55.31 |
2 | 2 | 20.01 |
2 | 2 | 24.36 |
2 | 2 | 61.5 |
2 | 2 | 8.18 |
2 | 2 | 5.65 |
2 | 2 | 25.55 |
2 | 2 | 59.76 |
2 | 2 | 13.05 |
2 | 2 | 59.57 |
2 | 2 | 58.27 |
2 | 2 | 30.81 |
2 | 2 | 29.82 |
2 | 2 | 37.57 |
2 | 2 | 30.7 |
2 | 2 | 21.52 |
2 | 2 | 13.12 |
2 | 2 | 57.62 |
2 | 2 | 20 |
2 | 2 | 41.03 |
2 | 2 | 39.97 |
2 | 2 | 36.46 |
Solution:
Here, we have to use two sample t test for the difference between two population means assuming equal population variances. The null and alternative hypotheses for this test are given as below:
Null hypothesis: H0: There is no any significant difference in the average ethics score of the male and female.
Alternative hypothesis: Ha: There is a significant difference in the average ethics score of the male and female.
H0: µ1 = µ2 versus Ha: µ1 ≠ µ2
We assume level of significance = α = 0.05
Test statistic formula for pooled variance t test is given as below:
t = (X1bar – X2bar) / sqrt[Sp2*((1/n1)+(1/n2))]
Where Sp2 is pooled variance
Sp2 = [(n1 – 1)*S1^2 + (n2 – 1)*S2^2]/(n1 + n2 – 2)
From given data, we are given
X1bar = 32.51429
X2bar = 37.17617
S1 = 11.60384
S2 = 15.72334
n1 = 252
n2 = 47
df = n1 + n2 – 2 = 252 + 47 – 2 = 297
α = 0.05
Critical values = - 1.9680 and 1.9680
(by using t-table or excel)
Sp2 = [(n1 – 1)*S1^2 + (n2 – 1)*S2^2]/(n1 + n2 – 2)
Sp2 = [(252 – 1)* 11.60384^2 + (47 – 1)* 15.72334^2]/(252 + 47 – 2)
Sp2 = 152.0849
t = (X1bar – X2bar) / sqrt[Sp2*((1/n1)+(1/n2))]
t = (32.51429 – 37.17617) / sqrt[152.0849*((1/252)+(1/47))]
t = -4.6619/ 1.9594
t = -2.3792
P-value = 0.0180
(by using t-table or excel)
P-value < α = 0.05
So, we reject the null hypothesis
There is sufficient evidence to conclude that there is a significant difference in the average ethics score of the male and female.
Confidence interval for difference between two population means is given as below:
Confidence interval = (X1bar – X2bar) ± t*sqrt[Sp2*((1/n1)+(1/n2))]
Where Sp2 is pooled variance
Sp2 = [(n1 – 1)*S1^2 + (n2 – 1)*S2^2]/(n1 + n2 – 2)
Sp2 = 152.0849
(X1bar – X2bar) = -4.6619
We assume confidence level = 95%
df = 297
Critical t value = 1.9680
(by using t-table)
Confidence interval = -4.6619 ± 1.9680*1.9594
Confidence interval = -4.6619 ± 3.8561
Lower limit = -4.6619 - 3.8561 = -8.5180
Upper limit = -4.6619 + 3.8561 = -0.8058
Confidence interval = (-8.5180, -0.8058)
This confidence interval does not contain 0, so we reject the null hypothesis.
There is sufficient evidence to conclude that there is a significant difference in the average ethics score of the male and female.