S9 NonParametricTest

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

LECTURE 9.

NON-PARAMETRIC TEST
▪ 1. Poisson distribution Test
▪ 2. Normality Chisq Test
▪ 3. Normality Jacque-Bera Test
▪ 4. Rank Correlation Test

▪ [1] Chapter 15

1
1. Poisson Distribution Test
▪ Variable X is Poisson Distribution if the Probability
function is
𝜆𝑥 𝑒 −𝜆
𝑃 𝑋=𝑥 = , 𝜆 > 0, 𝑥 = 0,1,2, …
𝑥!
▪ Property:
▪ Mean value: 𝐸 𝑋 = 𝜆; 𝑉 𝑋 = 𝜆
▪ Proportional to scale (in space or time)

2
Example 1
▪ Number of forgotten luggage on X Freq
trains (X) is shown on table. At 0 30
significant level of 5%
1 50
▪ (a) Test the hypothesis that X is
Poisson distributed with mean of 3 2 70
▪ (b) Test hypothesis that X is 3 65
Poisson distributed 4 45
▪ (c) Find the P-value of the tests 5 25
≥6 15

3
Example 1
▪ H0: 𝑋 ~𝑃 𝜆 = 3 (F-
X Freq Prob. Ei
▪ Excel E)^2/E
2
▪ 𝜒𝑠𝑡𝑎𝑡 = 21.59 0 30 0.050
2
▪ 𝜒𝑐𝑟𝑖𝑡 = 𝜒 26 0.05 = 1 50 0.149
12.59 2
2
70 0.224
2
▪ 𝜒𝑠𝑡𝑎𝑡 > 𝜒𝑐𝑟𝑖𝑡 →
Reject H0 3 65 0.224
▪ At 5%, there is 4 45 0.168
insufficient evidence
to conclude that X is 5 25 0.101
Poisson distributed ≥ 6 15
with mean of 3

4
Example 1
▪ H0: 𝑋 ~𝑃 𝜆
▪ Estimate 𝜆 by sample mean
X Freq xifi Prob. Ei (Fi—Ei)2/Ei
0 30 0 0.074 22.3 2.673
1 50 50 0.193 57.9 1.086
2 70 140 0.251 75.3 0.375
3 65 195 0.218 65.3 0.001
4 45 180 0.141 42.4 0.156
5 25 125 0.074 22.1 0.391
≥6 15 90 0.049 14.7 0.006
∑ 300 780 1 300 4.689
5
2. Normality Chi-sq Test
▪ H0: Variable X is Normality 𝑁(28,72 )
2
▪ 𝜒𝑠𝑡𝑎𝑡 = 11.23
2
▪ 𝜒𝑐𝑟𝑖𝑡 = 𝜒 2𝑘−𝑚−1 𝛼 = 𝜒 25−0−1 0.05 = 𝜒 24 0.05 = 9.488
2
▪ 𝜒𝑠𝑡𝑎𝑡 > 𝜒 24 0.05 → reject 𝐻0
X Freq Prob. E (F – E)2/E
20 – 24 10 0.157 15.7 2.088
24 – 28 25 0.288 21.6 0.530
28 – 32 30 0.288 21.6 3.253
32 – 36 20 0.157 15.7 1.159
36 – 40 15 0.253 25.3 4.200
∑ 100 1 100 11.23 6
2. Normality Chi-sq Test
▪ H0: Variable X is Normality
▪ Estimated mean: 𝑥ҧ =
▪ Estimated variance: 𝑚𝑠 =
X Freq Prob. E (F-E)2/E
20 – 24 10 0.099

24 – 28 25 0.225 22.5 0.279


28 – 32 30 0.322 32.2 0.151
32 – 36 20 0.240 24.0 0.671
36 – 40 15 0.114

∑ 100 1 100 1.778


7
▪ H0: Variable X is Normality
▪ Estimated mean: 𝑥ҧ = 30.2
▪ Estimated variance: 𝑚𝑠 = 23.16
2
▪ 𝜒𝑠𝑡𝑎𝑡 = 2.233
2
▪ 𝜒𝑐𝑟𝑖𝑡 = 𝜒 2𝑘−𝑚−1 𝛼 = 𝜒 25−2−1 0.05 = 𝜒 22 0.05 = 5.991
2
▪ 𝜒𝑠𝑡𝑎𝑡 < 𝜒 22 0.05 → not reject 𝐻0

8
3. Normality Jarque-Berra Test
▪ H0: Variable X is normal distributed
▪ Jarque-Bera test
𝑆𝑘𝑒𝑤 2 𝐾𝑢𝑟𝑡𝑜𝑠𝑖𝑠 2
▪ 𝐽𝐵 = 𝑛 +
6 24
∑𝑛 𝑋 𝑖 − 𝑥ҧ 3
▪ 𝑆𝑘𝑒𝑤 = 𝑖=1
𝑛𝑆 3
∑𝑛𝑖=1 𝑋𝑖 −𝑥ҧ
4
▪ 𝐾𝑢𝑟𝑡𝑜𝑠𝑖𝑠 = −3
𝑛𝑆 4
▪ If 𝐽𝐵 > 𝜒 22 𝛼 then reject H0

9
Example 3
Age ▪ Testing for normality
Mean 43.08 distribution of Customer’s
Standard Error 1.238905
Age, at 5%.
Median 42
Mode 46
Standard Deviation 12.38905
Sample Variance 153.4885
Kurtosis 0.066366
Skewness 0.524953
Range 58
Minimum 20
Maximum 78
Sum 4308
Count 100

10
Example
▪ H0: Age is normal distributed
▪ Jarque-Bera test
𝑆𝑘𝑒𝑤 2 𝐾𝑢𝑟𝑡𝑜𝑠𝑖𝑠 2
▪ 𝐽𝐵 = 𝑛 +
6 24
2 2
0.524953 0.066366
▪ = 100 + = 4.611
6 24

▪ 𝜒 22 𝛼 = 𝜒 22 0.05 = 5.991
▪ 𝐽𝐵 < 𝜒 22 0.05 Not reject H0

11
4. Rank Correlation Test
▪ Ranking value of ordinal or quantitative variable
X XS S XXS M L XXL XL
Rank 2 3 1 4 5 7 6

▪ Same values
Y S S XXS M L L XL
Equal Rank 2 2 1 4 5 5 7
Average Rank 2.5 2.5 1 4 5.5 5.5 7

12
Correlation
X Y X* Y* Y vs X

2 1 1 1
3 6 2 2
5 9 3 3
7 11 4 4
9 12 5 5
Y* vs X*
11 12 6 6
13 13 7 7
15 15 8 8
17 18 9 9
18 23 10 10
13
Spearman Rank Correlation
▪ Xi∗ , Yi∗ are rank value, di = Xi∗ − Yi∗
▪ Rank correlation (Spearman’s correlation)
6 ∑𝑛𝑖=1 𝑑𝑖2
𝑟𝑠 = 1 −
𝑛(𝑛2 − 1)
X Y X* Y*
10 5 1 1 ▪ Pearson’s correlation of X, Y
30 5 2 1 𝑟 𝑋, 𝑌 = 0,446
50 6 3 3
52 7 4 4 ▪ Spearman’s correlation of X, Y
53 10 5 5 𝑟𝑆 𝑋, 𝑌 =
55 40 6 6
14
Rank Test
▪ Testing for two Rank variable
▪ H0: X and Y are not associated
▪ H1: X and Y are associated
▪ If n ≤ 30:
▪ Z-Statistic: 𝑧 = 𝑟𝑠 𝑛 − 1
▪ 𝑧 > 𝑠(𝑛−1)𝛼/2 then reject H0
▪ If n > 30
𝑟𝑠 𝑛−2
▪ T-statistic: 𝑇 =
1−𝑟𝑠2

▪ 𝑇 > 𝑡(𝑛−2)𝛼/2 then reject H0

15
Rank test Critical value
n 0.05 0.025 0.01 n 0.05 0.025 0.01
5 .900 - - 18 .399 .476 .564
6 .829 .886 .943 19 .388 .462 .549
7 .714 .786 .893 20 .377 .450 .534
8 .643 .738 .833 21 .368 .438 .521
9 .600 .683 .783 22 .359 .428 .508
10 .564 .648 .745 23 .351 .418 .496
11 .523 .623 .736 24 .343 .409 .485
12 .497 .591 .703 25 .336 .400 .475
13 .475 .566 .673 26 .329 .392 .465
14 .457 .545 .646 27 .323 .385 .456
15 .441 .525 .623 28 .317 .377 .448
16 .425 .507 .601 29 .311 .370 .440
17 .412 .490 .582 30 .305 .364 .432
16
Example 4
▪ Ranking 10 firms by two dimension: Economic
efficient and Social efficient
▪ Testing for association of Economic and Social issue

Firm 1 2 3 4 5 6 7 8 9 10
Econ 2 4 5 7 6 9 1 8 10 3
Social 6 5 7 8 4 10 3 9 2 1

▪ 𝑟𝑆 =
▪ 𝑧𝑠𝑡𝑎𝑡 =

17
Relationship Tests
Qualitative
Quantitative
Non-Rank Rank

Non- Independence
Qualitative

Rank Chisq-test One-way


ANOVA
Spearman’s F-test
Rank correlation
Rank-test
Pearson
Quan- One-way ANOVA
correlation
titative F-test
Z-test
18
Relationship Tests
Qualitative
Quantitative
Rank Non-Rank
Spearman’s
Rank correlation
Qualitative

Rank-test
One-way
Non- Independence
ANOVA
rank Chisq-test
F-test
One-way Pearson’s
Quan-
ANOVA correlation
titative
F-test Z-test
19
Chapter 12. Nonparametric Testing

Summary
▪ Non-parametric Tests
▪ Goodness-of-fit Test: Chi-squared test
▪ Independence Test: Chi-squared test on contingency
table
▪ Normality Test: Chi-squared test or Jacque-Berra
▪ Correlation Test: Z-test
▪ Rank correlation Test: Spearman’s Test

20

You might also like