Statistics Exercises using MS Excel
1. Using t-test, compute if there is significant difference between the performance of Male and
Female in an examination.
Male Female
10 30
15 23
23 23
24 32
26 5
32 14
34 15
2 17
36 3
6 18
7 9
Answer:
1 - Null Hypothesis (H₀): There is no significant difference in the mean scores of males and
females.
H0: μ1= μ2H
Alternative Hypothesis (H₁): There is a significant difference in the mean scores of males and
females.
H1: μ1≠ μ2H
2 - Male Group
n1 = 11, xˉ1 = 10+15+…+7 = 20.45, s1≈11.72
11
Female Group
n1 = 11, xˉ1 = 30+23+…+9 = 16.36, s2≈8.30
11
3 – t = 20.45-16.36 = 4.09 = 4.09 = 4.09 = 0.944
√11.722+8.302 = √12.49+6.26 √18.75 4.33
4 - t= 0.944
df≈18.75
The two-tailed p-value is approximately 0.357
5 - At a significance level of 0.05, since p=0.357>0.05, we fail to reject the null hypothesis.
2. Using z-test, determine if there is a significant difference on the scores of the two groups in
an examination.
Group A Group B
55 54
65 50
34 46
65 47
44 32
51 34
53 38
47 39
49 42
25 44
42 45
35 23
18 21
14 4
21 45
4 34
14 5
5 32
6 44
34 22
22 21
21 28
23 29
43 38
45 45
57 51
54 57
44 43
43 44
35 20
Answer:
1 - Null Hypothesis (H₀): There is no significant difference in the mean scores of Group A and
Group B.
H0:μ1=μ2H
Alternative Hypothesis (H₁): There is a significant difference in the mean scores.
H1:μ1≠μ2H
This is a two-tailed test.
2 - Group A Scores:
55, 65, 34, 65, 44, 51, 53, 47, 49, 25, 42, 35, 18, 14, 21, 4, 14, 5, 6, 34, 22, 21, 23, 43, 45, 57, 54,
44, 43, 35
Group B Scores:
54, 50, 46, 47, 32, 34, 38, 39, 42, 44, 45, 23, 21, 4, 45, 34, 5, 32, 44, 22, 21, 28, 29, 38, 45, 51, 57,
43, 44, 20
3 – group A = n1=30
xˉ1=∑X1/30=35.47
s1=17.05
Group b = n2=30
xˉ2=∑X2/30=36.03
s2=12.23
4 - z = 35.47-36.3 = -0.56 = -0.56 = -0.56 = -0.56 = -0.146
√17.052+12.232 = √290.7+149.6 √9.69+4..99 √14.68 3.83
30 30 30 30
5 - For a two-tailed test at α=0.05 the critical z-values are ±1.96.
Calculated z≈−0.146
6 - Since the calculated ∣z∣=0.146<1.96|z| = 0.884>0.05
Corresponding p-value ≈ 0.884 (very high)
We fail to reject the null hypothesis.
3. Determine the correlation between two variables.
Variable 1 Variable 2
17 3
24 15
5 14
24 12
14 21
32 28
13 26
15 13
18 18
19 17
22 10
20 9
4 12
Answer:
r=[n∑X2−(∑X)2][n∑Y2−(∑Y)2]n∑(XY)−(∑X)(∑Y)
∑X=227,∑Y=198,∑XY=3587,∑X2=4665,∑Y2=3582,n=13
r= [13(4665)−2272][13(3582)−1982]13(3587)−(227)(198)
r= [60645−51529][46566−39204]46631−44946
r= 9116 × 73621685 = 671192641685≈8193.861685
r ≈ 0.206
Pearson Correlation Coefficient (r) ≈ 0.206
0.206 indicates a very weak positive correlation.
As Variable 1 increases, Variable 2 tends to increase slightly, but the relationship is not strong.
4. Compute the ANOVA, and determine if the is a difference among the groups.
Group 1 Group 2 Group 3
12 8 7
9 9 8
10 10 10
12 12 12
3 16 14
16 24 15
16 15 12
17 21 10
19 27 23
Answer:
Total number of observations (N):
N = 9 (Group 1) + 9 (Group 2) + 9 (Group 3) = 27
Xˉgrand = ∑Xall ≈ 13.96
27
SSB=n∑(Xˉi−Xˉgrand)2
SSB≈9[(13.78−13.96)2+(15.78−13.96)2+(12.33−13.96)2]≈90.22
SSW=∑∑(Xij−Xˉi)2≈817.57
MSB (Mean Square Between) = SSB / df_between ≈ 45.11
MSW (Mean Square Within) = SSW / df_within ≈ 34.07
F=MSB ≈ 45.11≈1.035
MSW 34.07
p≈0.371
Since p = 0.371 > 0.05, we fail to reject the null hypothesis.
5. Compute the chi-square test, and find out if there is a difference on the preference of the
respondents.
Preference Yellow Green Red Total
Male 17 29 16 62
Female 15 12 21 48
Total 32 41 37 110
Answer:
Null Hypothesis (H₀): There is no association between gender and color preference.
Alternative Hypothesis (H₁): There is an association between gender and color preference.
Expected frequency for each cell:
Eij = (Row total) x (column total)
Grand total
Preference Yellow Green Red
Male (62×32)/110 = 18.04 (62×41)/110 = 23.11 (62×37)/110 = 20.85
Female (48×32)/110 = 13.96 (48×41)/110 = 17.89 (48×37)/110 = 16.15
Total Chi-Square statistic ≈ 6.17
df=(r−1)(c−1)=(2−1)(3−1)=2
p-value ≈ 0.0458
Since p-value = 0.0458 < 0.05, we reject the null hypothesis.
There is a statistically significant difference in color preference between male and female
respondents at the 5% level of significance.