View
230
Download
0
Tags:
Embed Size (px)
Citation preview
1
Pertemuan 25Metode Non Parametrik-1
Matakuliah : A0064 / Statistik Ekonomi
Tahun : 2005
Versi : 1/1
2
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• Menyimpulkan hasil pengujian hipotesis dengan menggunakan uji tanda (the sign test), runtunan (the run test), dan Mainn-Whitney
3
Outline Materi
• Uji tanda (the sign test)
• Uji Runtunan (the runs test)
• Uji U-Mainn-Whitney
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-4
• Using Statistics
• The Sign Test
• The Runs Test - A Test for Randomness
• The Mann-Whitney U Test
• The Wilcoxon Signed-Rank Test• The Kruskal-Wallis Test - A Nonparametric
Alternative to One-Way ANOVA
Nonparametric Methods and Chi-Square Tests (1)14
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-5
• The Friedman Test for a Randomized Block Design
• The Spearman Rank Correlation Coefficient
• A Chi-Square Test for Goodness of Fit
• Contingency Table Analysis - A Chi-Square Test for Independence
• A Chi-Square Test for Equality of Proportions
• Summary and Review of Terms
Nonparametric Methods and Chi-Square Tests (2)14
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-6
• Parametric MethodsInferences based on assumptions about the
nature of the population distribution• Usually: population is normal
Types of tests• z-test or t-test
» Comparing two population means or proportions
» Testing value of population mean or proportion
• ANOVA» Testing equality of several population means
• Parametric MethodsInferences based on assumptions about the
nature of the population distribution• Usually: population is normal
Types of tests• z-test or t-test
» Comparing two population means or proportions
» Testing value of population mean or proportion
• ANOVA» Testing equality of several population means
14-1 Using Statistics (Parametric Tests)
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-7
• Nonparametric TestsDistribution-free methods making no
assumptions about the population distributionTypes of tests
• Sign tests» Sign Test: Comparing paired observations
» McNemar Test: Comparing qualitative variables
» Cox and Stuart Test: Detecting trend
• Runs tests» Runs Test: Detecting randomness
» Wald-Wolfowitz Test: Comparing two distributions
• Nonparametric TestsDistribution-free methods making no
assumptions about the population distributionTypes of tests
• Sign tests» Sign Test: Comparing paired observations
» McNemar Test: Comparing qualitative variables
» Cox and Stuart Test: Detecting trend
• Runs tests» Runs Test: Detecting randomness
» Wald-Wolfowitz Test: Comparing two distributions
Nonparametric Tests
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-8
• Nonparametric TestsRanks tests
• Mann-Whitney U Test: Comparing two populations
• Wilcoxon Signed-Rank Test: Paired comparisons
• Comparing several populations: ANOVA with ranks
» Kruskal-Wallis Test
» Friedman Test: Repeated measures
Spearman Rank Correlation CoefficientChi-Square Tests
• Goodness of Fit
• Testing for independence: Contingency Table Analysis
• Equality of Proportions
• Nonparametric TestsRanks tests
• Mann-Whitney U Test: Comparing two populations
• Wilcoxon Signed-Rank Test: Paired comparisons
• Comparing several populations: ANOVA with ranks
» Kruskal-Wallis Test
» Friedman Test: Repeated measures
Spearman Rank Correlation CoefficientChi-Square Tests
• Goodness of Fit
• Testing for independence: Contingency Table Analysis
• Equality of Proportions
Nonparametric Tests (Continued)
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-9
• Deal with enumerative (frequency counts) data.
• Do not deal with specific population parameters, such as the mean or standard deviation.
• Do not require assumptions about specific population distributions (in particular, the normality assumption).
• Deal with enumerative (frequency counts) data.
• Do not deal with specific population parameters, such as the mean or standard deviation.
• Do not require assumptions about specific population distributions (in particular, the normality assumption).
Nonparametric Tests (Continued)
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-10
• Comparing paired observationsPaired observations: X and Yp = P(X>Y)
• Two-tailed test H0: p = 0.50 H1: p0.50
• Right-tailed test H0: p 0.50 H1: p0.50
• Left-tailed test H0: p 0.50H1: p0.50
• Test statistic: T = Number of + signs
• Comparing paired observationsPaired observations: X and Yp = P(X>Y)
• Two-tailed test H0: p = 0.50 H1: p0.50
• Right-tailed test H0: p 0.50 H1: p0.50
• Left-tailed test H0: p 0.50H1: p0.50
• Test statistic: T = Number of + signs
14-2 Sign Test
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-11
• Small Sample: Binomial TestFor a two-tailed test, find a critical point corresponding
as closely as possible to /2 (C1) and define C2 as n-C1. Reject null hypothesis if T C1or T C2.
For a right-tailed test, reject H0 if T C, where C is the value of the binomial distribution with parameters n and p = 0.50 such that the sum of the probabilities of all values less than or equal to C is as close as possible to the chosen level of significance, .
For a left-tailed test, reject H0 if T C, where C is defined as above.
• Small Sample: Binomial TestFor a two-tailed test, find a critical point corresponding
as closely as possible to /2 (C1) and define C2 as n-C1. Reject null hypothesis if T C1or T C2.
For a right-tailed test, reject H0 if T C, where C is the value of the binomial distribution with parameters n and p = 0.50 such that the sum of the probabilities of all values less than or equal to C is as close as possible to the chosen level of significance, .
For a left-tailed test, reject H0 if T C, where C is defined as above.
Sign Test Decision Rule
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-12
Cumulative Binomial
Probabilities(n=15, p=0.5)x F(x)
0 0.00003 1 0.00049 2 0.00369 3 0.01758 4 0.05923 5 0.15088 6 0.30362 7 0.50000 8 0.69638 9 0.8491210 0.9407711 0.9824212 0.9963113 0.9995114 0.9999715 1.00000
CEO Before After Sign 1 3 4 1 + 2 5 5 0 3 2 3 1 + 4 2 4 1 + 5 4 4 0 6 2 3 1 + 7 1 2 1 + 8 5 4 -1 - 9 4 5 1 +10 5 4 -1 -11 3 4 1 +12 2 5 1 +13 2 5 1 +14 2 3 1 +15 1 2 1 +16 3 2 -1 -17 4 5 1 +
CEO Before After Sign 1 3 4 1 + 2 5 5 0 3 2 3 1 + 4 2 4 1 + 5 4 4 0 6 2 3 1 + 7 1 2 1 + 8 5 4 -1 - 9 4 5 1 +10 5 4 -1 -11 3 4 1 +12 2 5 1 +13 2 5 1 +14 2 3 1 +15 1 2 1 +16 3 2 -1 -17 4 5 1 +
n = 15 T = 120.025C1=3 C2 = 15-3 = 12H0 rejected, since TC2
C1
Example 14-1
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-13
Example 14-1- Using the Template
H0: p = 0.5H1: p Test Statistic: T = 12p-value = 0.0352.For = 0.05, the null hypothesisis rejected since 0.0352 < 0.05.
Thus one can conclude that there is a change in attitude toward aCEO following the award of anMBA degree.
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-14
A run is a sequence of like elements that are preceded and followed by different elements or no element at all.
A run is a sequence of like elements that are preceded and followed by different elements or no element at all.
Case 1: S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E : R = 20 Apparently nonrandomCase 2: SSSSSSSSSS|EEEEEEEEEE : R = 2 Apparently nonrandomCase 3: S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E : R = 12 Perhaps random
Case 1: S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E|S|E : R = 20 Apparently nonrandomCase 2: SSSSSSSSSS|EEEEEEEEEE : R = 2 Apparently nonrandomCase 3: S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E : R = 12 Perhaps random
A two-tailed hypothesis test for randomness:H0: Observations are generated randomlyH1: Observations are not generated randomly
Test Statistic:R=Number of Runs
Reject H0 at level if R C1 or R C2, as given in Table 8, with total tail probability P(R C1) + P(R C2) =
A two-tailed hypothesis test for randomness:H0: Observations are generated randomlyH1: Observations are not generated randomly
Test Statistic:R=Number of Runs
Reject H0 at level if R C1 or R C2, as given in Table 8, with total tail probability P(R C1) + P(R C2) =
14-3 The Runs Test - A Test for Randomness
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-15
Table 8: Number of Runs (r)(n1,n2) 11 12 13 14 15 16 17 18 19 20 . . .(10,10) 0.586 0.758 0.872 0.949 0.981 0.996 0.999 1.000 1.000 1.000
Case 1: n1 = 10 n2 = 10 R= 20 p-value0Case 2: n1 = 10 n2 = 10 R = 2 p-value 0Case 3: n1 = 10 n2 = 10 R= 12
p-value PR F(11)] = (2)(1-0.586) = (2)(0.414) = 0.828 H0 not rejected
Case 1: n1 = 10 n2 = 10 R= 20 p-value0Case 2: n1 = 10 n2 = 10 R = 2 p-value 0Case 3: n1 = 10 n2 = 10 R= 12
p-value PR F(11)] = (2)(1-0.586) = (2)(0.414) = 0.828 H0 not rejected
Runs Test: Examples
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-16
The mean of the normal distribution of the number of runs:
The standard deviation:
The
E Rn n
n n
n n n n n n
n n n n
R E R
R
R
( )
( )
( ) ( )
( )
21
2 2
1
1 2
1 2
1 2 1 2 1 2
1 2
2
1 2
standard normal test statistic:
z
The mean of the normal distribution of the number of runs:
The standard deviation:
The
E Rn n
n n
n n n n n n
n n n n
R E R
R
R
( )
( )
( ) ( )
( )
21
2 2
1
1 2
1 2
1 2 1 2 1 2
1 2
2
1 2
standard normal test statistic:
z
Large-Sample Runs Test: Using the Normal Approximation
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-17
Example 14-2: n1 = 27 n2 = 26 R = 15
0.0006=.9997)-2(1=value-p 47.3604.3
49.2715)(
604.3986.12146068
1896804
)12627(2)2627(
))2627)26)(27)(2)((26)(27)(2(
)121
(2)21
(
)2121
2(21
2
49.27149.261)2627(
)26)(27)(2(1
21
212
)(
R
RERz
nnnn
nnnnnn
R
nn
nnRE
H0 should be rejected at any common level of significance.
Large-Sample Runs Test: Example 14-2
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-18
Large-Sample Runs Test: Example 14-2 – Using the Template
Note:Note: The The computed p-value computed p-value using the template using the template is 0.0005 as is 0.0005 as compared to the compared to the manually manually computed value of computed value of 0.0006. The value 0.0006. The value of 0.0005 is more of 0.0005 is more accurate. accurate.
Reject the null Reject the null hypothesis that hypothesis that the residuals are the residuals are random.random.
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-19
The null and alternative hypotheses for the Wald-Wolfowitz test:H0: The two populations have the same distributionH1: The two populations have different distributions
The test statistic: R = Number of Runs in the sequence of samples, when the data from both samples have been sorted
The null and alternative hypotheses for the Wald-Wolfowitz test:H0: The two populations have the same distributionH1: The two populations have different distributions
The test statistic: R = Number of Runs in the sequence of samples, when the data from both samples have been sorted
Salesperson A: 35 44 39 50 48 29 60 75 49 66 Salesperson B: 17 23 13 24 33 21 18 16 32
Using the Runs Test to Compare Two Population Distributions (Means): the Wald-Wolfowitz Test
Example 14-3:Example 14-3:
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-20
Table Number of Runs (r)(n1,n2) 2 3 4 5 . . .(9,10) 0.000 0.000 0.002 0.004 ...
SalesSales Sales Person
Sales Person (Sorted) (Sorted) Runs35 A 13 B44 A 16 B39 A 17 B48 A 21 B60 A 24 B 175 A 29 A 249 A 32 B66 A 33 B 317 B 35 A23 B 39 A13 B 44 A24 B 48 A33 B 49 A21 B 50 A18 B 60 A16 B 66 A32 B 75 A 4
SalesSales Sales Person
Sales Person (Sorted) (Sorted) Runs35 A 13 B44 A 16 B39 A 17 B48 A 21 B60 A 24 B 175 A 29 A 249 A 32 B66 A 33 B 317 B 35 A23 B 39 A13 B 44 A24 B 48 A33 B 49 A21 B 50 A18 B 60 A16 B 66 A32 B 75 A 4
n1 = 10 n2 = 9 R= 4 p-value PR H0 may be rejected
n1 = 10 n2 = 9 R= 4 p-value PR H0 may be rejected
The Wald-Wolfowitz Test: Example 14-3
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-21
• Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks
• Kruskal-Wallis Test• Friedman Test: Repeated measures
• Ranks tests Mann-Whitney U Test: Comparing two populations Wilcoxon Signed-Rank Test: Paired comparisons Comparing several populations: ANOVA with ranks
• Kruskal-Wallis Test• Friedman Test: Repeated measures
Ranks Tests
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-22
The null and alternative hypotheses:H0: The distributions of two populations are identicalH1: The two population distributions are not identical
The Mann-Whitney U statistic:
where n1 is the sample size from population 1 and n2 is the sample size from population 2.
The null and alternative hypotheses:H0: The distributions of two populations are identicalH1: The two population distributions are not identical
The Mann-Whitney U statistic:
where n1 is the sample size from population 1 and n2 is the sample size from population 2.
U n nn n
R
1 21 1
1
12
( ) R Ranks from sample 11
E Un n n n n n
zU E U
U
U
[ ]( )
[ ]
1 2 1 2 1 2
21
12
The large - sample test statistic:
14-4 The Mann-Whitney U Test (Comparing Two Populations)
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-23
Cumulative Distribution Function of the Mann-Whitney U Statistic
n2=6n1=6
u...4 0.01305 0.02066 0.0325...
RankModel Time Rank SumA 35 5A 38 8A 40 10A 42 12A 41 11A 36 6 52B 29 2B 27 1B 30 3B 33 4B 39 9B 37 7 26
RankModel Time Rank SumA 35 5A 38 8A 40 10A 42 12A 41 11A 36 6 52B 29 2B 27 1B 30 3B 33 4B 39 9B 37 7 26
P(u5)
U n nn n
R
1 21 1 1
2 1
52
5
( )
= (6)(6) +(6)(6 + 1)
2
The Mann-Whitney U Test: Example 14-4
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-24
Example 14-5: Large-Sample Mann-Whitney U Test
Score RankScore Program Rank Sum85 1 20.0 20.087 1 21.0 41.092 1 27.0 68.098 1 30.0 98.090 1 26.0 124.088 1 23.0 147.075 1 17.0 164.072 1 13.5 177.560 1 6.5 184.093 1 28.0 212.088 1 23.0 235.089 1 25.0 260.096 1 29.0 289.073 1 15.0 304.062 1 8.5 312.5
Score RankScore Program Rank Sum85 1 20.0 20.087 1 21.0 41.092 1 27.0 68.098 1 30.0 98.090 1 26.0 124.088 1 23.0 147.075 1 17.0 164.072 1 13.5 177.560 1 6.5 184.093 1 28.0 212.088 1 23.0 235.089 1 25.0 260.096 1 29.0 289.073 1 15.0 304.062 1 8.5 312.5
Score RankScore Program Rank Sum65 2 10.0 10.057 2 4.0 14.074 2 16.0 30.043 2 2.0 32.039 2 1.0 33.088 2 23.0 56.062 2 8.5 64.569 2 11.0 75.570 2 12.0 87.572 2 13.5 101.059 2 5.0 106.060 2 6.5 112.580 2 18.0 130.583 2 19.0 149.550 2 3.0 152.5
Score RankScore Program Rank Sum65 2 10.0 10.057 2 4.0 14.074 2 16.0 30.043 2 2.0 32.039 2 1.0 33.088 2 23.0 56.062 2 8.5 64.569 2 11.0 75.570 2 12.0 87.572 2 13.5 101.059 2 5.0 106.060 2 6.5 112.580 2 18.0 130.583 2 19.0 149.550 2 3.0 152.5
Since the test statistic is z = -3.32,Since the test statistic is z = -3.32,the p-value the p-value 0.0005, and H0.0005, and H00 is rejected. is rejected.
Since the test statistic is z = -3.32,Since the test statistic is z = -3.32,the p-value the p-value 0.0005, and H0.0005, and H00 is rejected. is rejected.
U n nn n
R
E Un n
U
n n n n
zU E U
U
1 21 1 1
2 1
15 1515 15 1
2312 5 32 5
1 2
2
1 2 1 2 1
1215 15 15 15 1
24 109
32 5 112 5
24 1093 32
( )
( )( )( )( )
. .
[ ]
( )
( )( )( ).
[ ] . .
..
=(15)(15)
2= 112.5
12
COMPLETE 5 t h e d i t i o nBUSINESS STATISTICS
Aczel/SounderpandianMcGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., 2002
14-25
Example 14-5: Large-Sample Mann-Whitney U Test – Using the
Template
Since the test Since the test statistic is z = -3.32, statistic is z = -3.32, the p-value the p-value 0.0005, and H0.0005, and H00 is is
rejected.rejected.
That is, the LC That is, the LC (Learning Curve) (Learning Curve) program is more program is more effective.effective.
26
Penutup
• Pembahasan materi dilanjutkan dengan Materi Pokok 24 (Metode Non Parametrik-2)