Module 8 : Hypotheses Testing

Lecture 37 : Goodness of fit testing

 

 

t-test for avg. walking time of men and women

Variable 1 = Walking time for men

Variable 2 = Walking time for women

t-Test: Two-Sample Assuming Unequal Variances

 

Variable 1

Variable 2

Mean

32.60606061

35.85714286

Variance

162.8138821

218.4005468

Observations

297

210

Hypothesized Mean Difference

0

df

407

t Stat

-2.579738612

P(T<=t) one-tail

0.005118641

t Critical one-tail

1.64860612

P(T<=t) two-tail

0.010237281

t Critical two-tail

1.965809661

 

As t stat > 1.96 hence the difference between avg. walking time of men and women is significant. (Rejecting null hypothesis at 95% confidence level).

Problem for Chi-Square goodness of fit test

In this example the headway data collected on a road near Guwahati has been fitted to the negative exponential distribution and theoretical headway frequencies are obtained from the negative exponential distribution.

Table 8.2: Calculations involved in testing the closeness of the observed data with the assumed probability distribution

Class

Headway, t

Observed frequnecy

Obs.  Freq. h>t

Relative freq. (h>t)

Theor. Rel. freq.

Theor. Freq. (h>t)

Theor. Freq.

0 to 2

0.00

47

522.00

100.00

100.00

522.00

159

77.98

2 to 4

2.00

125

475.18

91.03

69.59

363.28

110

2.05

4 to 6

4.00

128

398.18

76.28

48.43

252.82

77

35.58

6 to 8

6.00

67

270.18

51.76

33.71

175.94

53

3.70

8 to 10

8.00

49

203.18

38.92

23.46

122.45

37

3.89

10 to 12

10.00

32

154.18

29.54

16.32

85.21

26

1.96

12 to 14

12.00

11

122.18

23.41

11.36

59.30

18

2.72

14 to 16

14.00

11

111.18

21.30

7.91

41.27

13

0.08

16 to 18

16.00

13

100.18

19.19

5.50

28.72

9

3.13

18 to 20

18.00

7

87.18

16.70

3.83

19.99

6

0.17

20 to 22

20.00

9

80.18

15.36

2.66

13.91

14

1.23

132.48

The statistic resulting from the last column of Table 8.2 follows chi-square distribution. Hypotheses formulation for this problem is given below;

H0: Headway data follows negative exponential distribution

H1: Headway data doesn't follow the negative exponential distribution

Chi-square calculated is 132.48 and the critical Chi-square value, for 11-1-1 = 9 degrees of freedom (1 for the mean headway and the other one for cumulative frequency) at 5 % significance level, is 3.33. Since the critical value is less than the calculated value the decision is “reject the null hypothesis that the headway data follows negative exponential distribution”.