Analysis of Data

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Analysis Of Data

Chi-squared Testing

To determine if there is a relation on a person’s heights and their shoe size.

1. Ho: There is no relationship between height and shoe size of a person.


2. H1: There is a relationship between height and shoe size of a person

Chi-squared statistic χ^2 using the formula: ∑(O-E)^2 Where: O=Observed frequency

E E=expected frequency

Shoe size Total


Height 24.1-26 26.1-28 28.1-30 30.1-32
151-160 4 3 0 0 7
161-170 3 13 1 0 17
171-180 1 16 4 0 21
181-190 0 6 3 4 13
191-200 0 0 1 1 2
Total 8 38 9 5 60

Table showing expected frequencies of each column.

Using the formula: E= Row total x column total

Grand total

0.94 3.74 1.05 0.58


2.27 10.77 2.25 1.42
2.80 13.30 3.15 1.75
1.74 8.24 1.95 1.68
0.27 1.27 0.30 0.17

O E ∑((O-E)^2)÷E
4.00 0.94 9.96
3.00 2.27 0.24
1.00 2.80 1.16
0.00 1.74 1.74
0.00 0.27 0.27
3.00 3.74 0.15
13.00 10.77 0.46
16.00 13.30 0.59
6.00 8.24 0.61
0.00 1.27 1.27
0.00 1.05 1.05
1.00 2.25 0.69
4.00 3.15 0.23
3.00 1.95 0.57
1.00 0.30 1.63
0.00 0.58 0.58
0.00 1.42 1.42
0.00 1.75 1.75
4.00 1.68 7.89
1.00 0.17 4.05
O=60 E=60 χ^2=35.74

Calculate the number of degrees of freedom, and determine the critical region.

Number of degrees of freedom= (number of rows-1)x(numbers of columns – 1)

= (4-1)x(5-1)

=12

According to the chi-squared distribution table, the rejection region was found to be
P(X≥21.026) with 5% level of significance.

Since χ^2 value is > than 35.74, we reject the null hypothesis and conclude that there is a
relationship between a persons height and their shoe size.
Correlation and Regression
To determine the strength and direction of the relationship between a preson’s height and their
shoe size, the correlation coefficient can be calculated.

1. Correlation coefficient, r,= n ¿ ¿

Where n=sample size

X=height

Y=shoe size
2 2
Height(X) Shoe size(Y) XY x y
152 25.4 3860.8 23104 645.16
153 26.6 4069.8 23409 707.56
156 25.4 3962.4 24336 645.16
156 26.2 4087.2 24336 686.44
158 24.6 3886.8 24964 605.16
158 27.1 4281.8 24964 734.41
160 24.6 3939.0 25600 605.15
160 26.6 4256.0 25600 707.56
162 26.6 4309.2 26244 707.56
163 27.1 4417.3 26569 734.41
165 25.8 4257.0 27225 665.64
165 26.2 4323.0 27225 686.44
165 26.2 4323.0 27225 686.44
165 26.2 4323.0 27225 686.44
167 26.2 4375.4 27889 686.44
167 26.3 4392.1 27889 691.69
167 27.9 4659.3 27889 778.41
168 25.8 4334.4 28224 665.64
168 26.6 4468.8 28224 707.56
168 26.6 4468.8 28224 707.56
170 25.8 4386.0 28900 665.64
170 26.6 4522.0 28900 707.56
170 27.1 4607.0 28900 734.41
170 28.8 4896.0 28900 829.44
171 27.5 4702.5 29241 756.25
172 25.8 4437.6 29584 665.64
172 27.5 4730.0 29584 756.25
173 26.6 4601.8 29929 707.56
174 27.1 4715.4 30276 734.41
175 26.6 4655.0 30625 707.56
175 27.1 4742.5 30625 734.41
175 27.5 4812.5 30625 756.25
175 27.9 4882.5 30625 778.41
175 27.9 4882.5 30625 778.41
175 28.3 4952.5 30625 800.89
176 28.8 5068.8 30976 829.44
177 27.9 4938.3 31329 778.41
178 26.2 4663.6 31684 686.44
178 27.1 4823.8 31684 734.41
180 27.1 4878.0 32400 734.41
180 27.1 4878.0 32400 734.41
180 27.9 5022.0 32400 778.41
180 28.3 5094.0 32400 800.89
182 27.5 5005.0 33124 756.25
182 28.8 5241.6 33124 829.44
183 27.5 5032.5 33489 756.25
185 27.9 5161.5 34225 778.41
185 28.8 5328.0 34225 829.44
185 30.5 5642.5 34225 930.25
185 30.5 5642.5 34225 930.25
185 30.5 5642.5 34225 930.25
187 27.5 5142.5 34969 756.25
187 27.5 5142.5 34969 756.25
187 29.6 5535.2 34969 876.16
188 27.9 5245.2 35344 778.41
188 29.6 5564.8 35344 876.16
189 31.4 5934.6 35721 985.96
193 29.6 5712.8 37249 876.16
195 30.9 6025.5 38025 954.81
165 27.5 4537.5 27225 756.25
∑X=10415 ∑Y=1645.7 ∑XY=282098.1 ∑ x 2=¿1814279 ∑ y 2=¿ 45287.70

60 ( 282098.1) −(10415)(1645.7)
Correlation coefficient, r, =
√¿¿

=-2.117x10−4

Since r is equal to =-2.117x10−4 we can infer that there is a strong, negative, correlation
between a person’s height and their shoe size.
Regression line Y on X
The linear equation of obtained data can be determined in the form of Y=a + bx where:

n ∑ xy−∑ x ∑ y
b=
n ∑ x −¿ ¿ ¿
2

a= y-bx

y=
∑y x=
∑x
n n

60 ( 282098.1) −(10415 ×1643.7)


b= = -0.557
60 ( 1814279 )−(10415)2

1645.7 10415
y= = 27.4 x= =173.6
60 60

a= 27.4- (-0.557)(173.6) = 124.1

therefore, linear equation of a person’s height versus their shoe size is y=124.1-0.557x.

as such the predicted shoe size of a lower 6 student at presentation college can be found.
Discussion

In the research conducted, it was determined that there was a relationship between a persons
height and their shoe size.
This was determined by performing a chi-squared test on a sample of 60 students, and testing
the null hypothesis, there is no relationship between a person’s height and their shoe size, against
an alternative hypothesis, there is a relationship between a persons height and their shoe size,
with a 5 % level of significance. The test statistic value was determined to be 35.74.
The degrees of freedom were 12 and according to the chi-squared distribution, the rejection
region was found to be P(X≥ 21.026). As the test statistic was > than 35.74, the null hypothesis
was rejected, and it was concluded that there is a relationship between a person’s height and their
shoe size.

A correlation test was then done to further determine the direction of the relationship. The
correlation coefficient, r, was calculated to be -2.117x10−4 which suggested that there was a
negative correlation i.e. as one variable increased the other decreased. The magnitude of the r
value tells us that there is strong correlation between the values which could mean that other
variables could have affected the result. A linear regression line equation for the data collected in
experiment was calculated and found to be, y=124.1-0.557x.

The calculated correlation coefficient when compared to online statistics showed that they both had a
negative correlation however the calculated coefficient had a greater magnitude. This can be attributed to
the smaller sample size which may have provided less variation

You might also like