14-1 COMPLETE COMPLETE BUSINESS BUSINESS STATISTICS STATISTICS by by AMIR D. ACZEL AMIR D. ACZEL & & JAYAVEL SOUNDERPANDIAN JAYAVEL SOUNDERPANDIAN 6 6 th th edition. edition. 14-2 Chapter 14 Chapter 14 Nonparametric Nonparametric Methods and Methods and Chi Chi - - Square Tests Square Tests 14-3 • 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 Nonparametric Methods and Chi - - Square Tests (1) Square Tests (1) 14 14 14-4 • 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 Nonparametric Methods and Chi Nonparametric Methods and Chi - - Square Tests (2) Square Tests (2) 14 14
14
Embed
14-1 Chapter 14 COMPLETE BUSINESS STATISTICS …€¢A Chi-Square Test for Equality of Proportions Nonparametric Methods and Chi-14 Square Tests (2) 14-5 •Differentiate between parametric
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Nonparametric Nonparametric Methods and Methods and
ChiChi--Square TestsSquare Tests
14-3
• 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 ChiNonparametric Methods and Chi--Square Tests (1)Square Tests (1)1414
14-4
• 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
Nonparametric Methods and ChiNonparametric Methods and Chi--Square Tests (2)Square Tests (2)1414
14-5
• Differentiate between parametric and nonparametric tests
• Conduct a sign test to compare population means• Conduct a runs test to detect abnormal sequences• Conduct a Mann-Whitney test for comparing
population distributions• Conduct a Wilkinson’s test for paired differences
LEARNING OBJECTIVESLEARNING OBJECTIVES1414
After reading this chapter you should be able to:After reading this chapter you should be able to:
14-6
•Conduct a Friedman’s test for randomized block designs
•Compute Spearman’s Rank Correlation Coefficient for ordinal data
•Conduct a chi-square test for goodness-of-fit•Conduct a chi-square test for independence•Conduct a chi-square test for equality of
proportions
LEARNING OBJECTIVES (2)LEARNING OBJECTIVES (2)1414After reading this chapter you should be able to:After reading this chapter you should be able to:
14-7
•Parametric MethodsInferences based on assumptions about the
nature of the population distributionUsually: population is normal
Types of testsz-test or t-test» Comparing two population means or proportions» Testing value of population mean or proportion
ANOVA» Testing equality of several population means
1414--1 Using Statistics (Parametric 1 Using Statistics (Parametric Tests)Tests)
14-8
•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
•Nonparametric TestsRanks tests• Mann-Whitney U Test: Comparing two populations• Wilcoxon Signed-Rank Test: Paired comparisons• Comparing several populations: ANOVA with ranks
•Comparing paired observationsPaired observations: X and Yp = P(X > Y)
Two-tailed test H0: p = 0.50 H1: p ≠ 0.50
Right-tailed test H0: p ≤ 0.50 H1: p > 0.50
Left-tailed test H0: p ≥ 0.50H1: p < 0.50
Test statistic: T = Number of + signs
1414--2 Sign Test2 Sign Test
14-12
•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.
n = 15 T = 12α ≈ 0.025C1=3 C2 = 15-3 = 12H0 rejected, since T ≥ C2
n = 15 T = 12α ≈ 0.025C1=3 C2 = 15-3 = 12H0 rejected, since T ≥ C2
C1
Example 14Example 14--11
14-14
Example 14Example 14--11-- Using the TemplateUsing the Template
H0: p = 0.5H1: p ≠ 0.5Test 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.
H0: p = 0.5H1: p ≠ 0.5Test 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.
14-15
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) = α.
1414--3 The Runs Test 3 The Runs Test -- A Test for A Test for Randomness Randomness
14-16
Table 8: Number of Runs (r)(n1,n2) 11 12 13 14 15 16 17 18 19 20
The mean of the normal distribution of the number of runs:
The standard deviation:
The
E R n nn n
n n n n n nn n n n
R E R
R
R
( )
( )( ) ( )
( )
=+
+
=− −
+ + −
=−
2 1
2 21
1 2
1 2
1 2 1 2 1 2
1 2
2
1 2
σ
σ
standard normal test statistic:
z
LargeLarge--Sample Runs Test: Using the Sample Runs Test: Using the Normal ApproximationNormal Approximation
14-18
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.
LargeLarge--Sample Runs Test: Example Sample Runs Test: Example 1414--22
14-19
LargeLarge--Sample Runs Test: Example Sample Runs Test: Example 1414--2 2 –– Using the TemplateUsing the Template
Note:The computed p-value using the template is 0.0005 as compared to the manually computed value of 0.0006. The value of 0.0005 is more accurate.
Reject the null hypothesis that the residuals are random.
Note:Note:The computed p-value using the template is 0.0005 as compared to the manually computed value of 0.0006. The value of 0.0005 is more accurate.
Reject the null hypothesis that the residuals are random.
14-20
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
Using the Runs Test to Compare Two Population Using the Runs Test to Compare Two Population Distributions (Means): the WaldDistributions (Means): the Wald--Wolfowitz TestWolfowitz Test
Example 14Example 14--3:3:
14-21
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 = 2[P(R ≤ 4)] = 0.002H0 may be rejected
n1 = 10 n2 = 9 R= 4 p-value = 2[P(R ≤ 4)] = 0.002H0 may be rejected
The WaldThe Wald--Wolfowitz Test: Example Wolfowitz Test: Example 1414--33
14-22
• Ranks testsMann-Whitney U Test: Comparing two populationsWilcoxon Signed-Rank Test: Paired comparisonsComparing several populations: ANOVA with ranks• Kruskal-Wallis Test• Friedman Test: Repeated measures
• Ranks testsMann-Whitney U Test: Comparing two populationsWilcoxon Signed-Rank Test: Paired comparisonsComparing several populations: ANOVA with ranks• Kruskal-Wallis Test• Friedman Test: Repeated measures
Ranks TestsRanks Tests
14-23
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 n n n R= ++
− = ∑1 21 1
1
12
( ) R Ranks from sample 11
E Un n n n n n
z U E UU
U
[ ]( )
[ ]= =
+ +
=−
1 2 1 2 1 2
21
12
The large - sample test statistic:
σ
σ
1414--4 The Mann4 The Mann--Whitney U Test Whitney U Test (Comparing Two Populations)(Comparing Two Populations)
14-24
Cumulative Distribution Function of the Mann-Whitney U Statistic
Since the test statistic is z = -3.32,the p-value ≈ 0.0005, and H0 is rejected.
Since the test statistic is z = -3.32,the p-value ≈ 0.0005, and H0 is rejected.
U n nn n
R
E Un n
Un n n n
zU E U
U
= ++
−
= ++
− =
=
=+ +
=+ +
=
=−
=−
= −
1 21 1 1
2 1
15 1515 15 1
2312 5 32 5
1 22
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
σ
σ
14-26
Example 14Example 14--5: Large5: Large--SampleSampleMannMann--Whitney U Test Whitney U Test –– Using the TemplateUsing the Template
Since the test statistic is z = -3.32, the p-value ≈ 0.0005, and H0 is rejected.
That is, the LC (Learning Curve) program is more effective.
Since the test Since the test statistic is z = statistic is z = --3.32, 3.32, the pthe p--value value ≈≈ 0.0005, 0.0005, and Hand H00 is rejected.is rejected.
That is, the LC That is, the LC (Learning Curve) (Learning Curve) program is more program is more effective.effective.
14-27
The null and alternative hypotheses:H0: The median difference between populations are 1 and 2 is zeroH1: The median difference between populations are 1 and 2 is not zero
Find the difference between the ranks for each pair, D = x1 -x2, and then rank the absolute values of the differences. The Wilcoxon T statistic is the smaller of the sums of the positive ranks and the sum of the negative ranks:
For small samples, a left-tailed test is used, using the values in Appendix C, Table 10.
The large-sample test statistic:
The null and alternative hypotheses:H0: The median difference between populations are 1 and 2 is zeroH1: The median difference between populations are 1 and 2 is not zero
Find the difference between the ranks for each pair, D = x1 -x2, and then rank the absolute values of the differences. The Wilcoxon T statistic is the smaller of the sums of the positive ranks and the sum of the negative ranks:
For small samples, a left-tailed test is used, using the values in Appendix C, Table 10.
The large-sample test statistic:
( )T = + −∑∑min ( ), ( )
E Tn n
Tn n n
[ ]( ) ( )( )
=+
=+ +1
4
1 2 1
24 σ
zT E T
T=
− [ ]σ
1414--5 The Wilcoxon Signed5 The Wilcoxon Signed--Ranks Ranks Test (Paired Ranks)Test (Paired Ranks)
14-28
Sold Sold Rank Rank Rank(1) (2) D=x1-x2 ABS(D) ABS(D) (D>0) (D<0)
Example 14Example 14--8: The Kruskal8: The Kruskal--Wallis Wallis TestTest
14-33
Example 14Example 14--8: The Kruskal8: The Kruskal--Wallis Wallis Test Test –– Using the TemplateUsing the Template
14-34
If the null hypothesis in the Kruskal-Wallis test is rejected, then we may wish, in addition, compare each pair of populations to determine which are different and which are the same.
If the null hypothesis in the Kruskal-Wallis test is rejected, then we may wish, in addition, compare each pair of populations to determine which are different and which are the same.
The pairwise comparison test statistic: where R is the mean of the ranks of the observations frompopulation i.
The critical point for the paired comparisons:
C
Reject if D > C
i
KW
KW
D R R
n nn n
i j
ki j
= −
=+⎡
⎣⎢⎤⎦⎥
+⎛⎝⎜
⎞⎠⎟−( ) ( )
,χ α 12 1
121 1
Further Analysis (Pairwise Further Analysis (Pairwise Comparisons of Average Ranks) Comparisons of Average Ranks)
14-35
Critical Point:
C
D
D
D
KW
1,2
1,3
2,3
=+⎡
⎣⎢⎤⎦⎥
+⎛⎝⎜
⎞⎠⎟
=+
+⎛⎝⎜
⎞⎠⎟
= =
= = = − =
= = = − =
= = = − =
−( ) ( )
( ) ( )
.
. ***
.
,χ α ki j
n nn n
R
R
R
12
1
2
3
112
1 1
9.21034 18 18 112
16
16
87.49823 9.35
906 15 15 9.33 5 67
566 9.33 15 4.17 10 83
256 4.17 9.33 4.17 516
Pairwise Comparisons: Example 14Pairwise Comparisons: Example 14--88
14-36
The Friedman test is a nonparametric version of the randomized block design ANOVA. Sometimes this design is referred to as a two-way ANOVA with one item per cell because it is possible to view the blocks as one factor and the treatment levels as the other factor. The test is based on ranks.
The Friedman test is a nonparametric version of the randomized block design ANOVA. Sometimes this design is referred to as a two-way ANOVA with one item per cell because it is possible to view the blocks as one factor and the treatment levels as the other factor. The test is based on ranks.
1414--7 The Friedman Test for a 7 The Friedman Test for a Randomized Block DesignRandomized Block Design
The Friedman hypothesis test:H0: The distributions of the k treatment populations are identicalH1: Not all k distribution are identical
The Friedman test statistic:
The degrees of freedom for the chi-square distribution is (k – 1).
The Friedman hypothesis test:H0: The distributions of the k treatment populations are identicalH1: Not all k distribution are identical
The Friedman test statistic:
The degrees of freedom for the chi-square distribution is (k – 1).
∑=
+−+
=k
j jknR
knk 1
22 )1(3)1(
12χ
14-37
Example 14Example 14--10 10 –– using the Templateusing the Template
Note: The p-value is small relative to a significance level of α = 0.05, so one should conclude that there is evidence that not all three low-budget cruise lines are equally preferred by the frequent cruiser population
Note:Note: The p-value is small relative to a significance level of α = 0.05, so one should conclude that there is evidence that not all three low-budget cruise lines are equally preferred by the frequent cruiser population
14-38
The Spearman Rank Correlation Coefficient is the simple correlation coefficient calculated from variables converted to ranks from their original values.The Spearman Rank Correlation Coefficient is the simple correlation coefficient calculated from variables converted to ranks from their original values.
The Spearman Rank Correlation Coefficient (assuming no ties):
rs where di = R(xi ) - R(yi )
Null and alternative hypotheses: H0: = 0 H1: 0Critical values for small sample tests from Appendix C, Table 11Large sample test statistic: z = rs
= − =∑
−
≠
−
16 2
12 1
1
dii
n
n n
ss
n
( )
( )
ρρ
1414--8 The Spearman Rank Correlation 8 The Spearman Rank Correlation CoefficientCoefficient
Spearman Rank Correlation Spearman Rank Correlation Coefficient: Example 14Coefficient: Example 14--1111
14-40
Spearman Rank Correlation Coefficient: Spearman Rank Correlation Coefficient: Example 14Example 14--11 Using the Template11 Using the Template
Note:The p-values in the range J15:J17 will appear only if the sample size is large (n > 30)
Note:Note:The p-values in the range J15:J17 will appear only if the sample size is large (n > 30)
14-41
Steps in a chi-square analysis:Formulate null and alternative hypothesesCompute frequencies of occurrence that would be expected if the null hypothesis were true - expected cell countsNote actual, observed cell countsUse differences between expected and actual cell counts to find chi-square statistic:
Compare chi-statistic with critical values from the chi-square distribution (with k-1 degrees of freedom) to test the null hypothesis
Steps in a chi-square analysis:Formulate null and alternative hypothesesCompute frequencies of occurrence that would be expected if the null hypothesis were true - expected cell countsNote actual, observed cell countsUse differences between expected and actual cell counts to find chi-square statistic:
Compare chi-statistic with critical values from the chi-square distribution (with k-1 degrees of freedom) to test the null hypothesis
χ 22
1=
−=∑ ( )O E
Ei i
ii
k
1414--9 A Chi9 A Chi--Square Test for Square Test for Goodness of FitGoodness of Fit
14-42
The null and alternative hypotheses:H0: The probabilities of occurrence of events E1, E2...,Ek are given by
p1,p2,...,pkH1: The probabilities of the k events are not as specified in the null
hypothesis
The null and alternative hypotheses:H0: The probabilities of occurrence of events E1, E2...,Ek are given by
p1,p2,...,pkH1: The probabilities of the k events are not as specified in the null
hypothesis
Assuming equal probabilities, p1= p2 = p3 = p4 =0.25 and n=80Preference Tan Brown Maroon Black TotalObserved 12 40 8 20 80Expected(np) 20 20 20 20 80(O-E) -8 20 -12 0 0
χ χ2
2
1
82
20
202
20
122
20
02
2030 4
0 01 32
11 3449=−
=∑ =
−+ +
−+ = > =
( ) ( ) ( ) ( ) ( ).
( . , ).
Oi EiEii
k
H is rejected at the 0.01 level.0
Example 14Example 14--12: Goodness12: Goodness--ofof--Fit Test Fit Test for the Multinomial Distributionfor the Multinomial Distribution
14-43
Example 14Example 14--12: Goodness12: Goodness--ofof--Fit Test for the Fit Test for the Multinomial Distribution using the TemplateMultinomial Distribution using the Template
Note:Note:the p-value is 0.0000, so we can reject the null hypothesis at any α level.
14-44
50-5
0.4
0.3
0.2
0.1
0.0 z
f(z)
Partitioning the Standard Normal Distribution
-1 1
-0.44 0.44
0.1700
0.1713
0.15870.1587
0.1700
0.1713
1. Use the table of the standard normal distribution to determine an appropriate partition of the standard normal distribution which gives ranges with approximately equal percentages.p(z<-1) = 0.1587p(-1<z<-0.44) = 0.1713p(-0.44<z<0) = 0.1700p(0<z<0.44) = 0.1700p(0.44<z<14) = 0.1713p(z>1) = 0.1587
2. Given z boundaries, x boundaries can be determined from the inverse standard normal transformation: x = µ + σz = 125 + 40z.
3. Compare with the critical value of the χ2 distribution with k-3 degrees of freedom.
GoodnessGoodness--ofof--Fit for the Normal Fit for the Normal Distribution: Example 14Distribution: Example 14--1313
14-45
i Oi Ei Oi - Ei (Oi - Ei)2 (Oi - Ei)2/ Ei1 14 15.87 -1.87 3.49690 0.220352 20 17.13 2.87 8.23691 0.480853 16 17.00 -1.00 1.00000 0.058824 19 17.00 2.00 4.00000 0.235295 16 17.13 -1.13 1.27690 0.074546 15 15.87 -0.87 0.75690 0.04769
χ2: 1.11755
i Oi Ei Oi - Ei (Oi - Ei)2 (Oi - Ei)2/ Ei1 14 15.87 -1.87 3.49690 0.220352 20 17.13 2.87 8.23691 0.480853 16 17.00 -1.00 1.00000 0.058824 19 17.00 2.00 4.00000 0.235295 16 17.13 -1.13 1.27690 0.074546 15 15.87 -0.87 0.75690 0.04769
χ2: 1.11755
χ2(0.10,k-3)= 6.5139 > 1.11755 ⇒ H0 is not rejected at the 0.10 level
Example 14Example 14--13: Solution13: Solution
14-46
Example 14Example 14--13: Solution using the 13: Solution using the TemplateTemplate
Note:Note: p-value = 0.8002 > 0.01 ⇒ H0 is not rejected at the 0.10 level
1414--9 Contingency Table Analysis: 9 Contingency Table Analysis: A ChiA Chi--Square Test for IndependenceSquare Test for Independence
14-48
Null and alternative hypotheses:H0: The two classification variables are independent of each otherH1: The two classification variables are not independent
Chi-square test statistic for independence:
Degrees of freedom: df=(r-1)(c-1)
Expected cell count:
χ 22
11=
−==
∑∑( )O E
Eij ij
ijj
c
i
r
ER C
niji j=
A and B are independent if:P(A ∩ B) = P(A)×P(B). If the first and second classification categories are independent:Eij = (Ri)(Cj)/n
A and B are independent if:P(A ∩ B) = P(A)×P(B). If the first and second classification categories are independent:Eij = (Ri)(Cj)/n
Contingency Table Analysis: Contingency Table Analysis: A ChiA Chi--Square Test for IndependenceSquare Test for Independence
14-49
Industry TypeService
(Expected)Nonservice(Expected) Total
Profit(Expected)
42(60*48/100)=28.8
18(60*52/100)=31.2
60
Loss(Expected)
6(40*48/100)=19.2
34(40*52/100)=20.8
40
Total 48 52 100
ij O E O-E (O-E)2 (O-E)2/E11 42 28.8 13.2 174.24 6.050012 18 31.2 -13.2 174.24 5.584621 6 19.2 -13.2 174.24 9.075022 34 20.8 13.2 174.24 8.3769
χ2: 29.0865
χ2(0.01,(2-1)(2-1))=6.63490
H0 is rejected at the 0.01 level andit is concluded that the two variablesare not independent.
( )Yates corrected 2 for a 2x2 table:
2
χ
χ =− −
∑∑Oij Eij
Eij
0 52
.
Contingency Table Analysis: Contingency Table Analysis: Example 14Example 14--1414
14-50
Since p-value = 0.000, H0 is rejected at the 0.01 level and it is concluded that the two variables are not independent.
Since p-value = 0.000, H0 is rejected at the 0.01 level and it is concluded that the two variables are not independent.
Contingency Table Analysis: Contingency Table Analysis: Example 14Example 14--14 using the Template14 using the Template
Note:When the contingency table is a 2x2, one should use the Yates correction.
Note:Note:When the contingency table is a 2x2, one should use the Yates correction..
14-51
1414--11 Chi11 Chi--Square Test for Equality Square Test for Equality of Proportionsof Proportions
Tests of equality of proportions across several populations are also called tests of homogeneity.Tests of equality of proportions across several populations are also called tests of homogeneity.tests of homogeneity.
In general, when we compare c populations (or r populations if they are arranged as rows rather than columns in the table), then the Null and alternative hypotheses:
H0: p1 = p2 = p3 = … = pcH1: Not all pi, I = 1, 2, …, c, are equal
Chi-square test statistic for equal proportions:
Degrees of freedom: df = (r-1)(c-1)
Expected cell count:
χ 22
11=
−==
∑∑( )O E
Eij ij
ijj
c
i
r
ER C
niji j=
14-52
1414--11 Chi11 Chi--Square Test for Equality Square Test for Equality of Proportions of Proportions -- ExtensionExtension
The Median TestThe Median TestThe Median Test
Here, the Null and alternative hypotheses are:
H0: The c populations have the same medianH1: Not all c populations have the same median
Here, the Null and alternative hypotheses are:
H0: The c populations have the same medianH1: Not all c populations have the same median
14-53
ChiChi--Square Test for the Median: Square Test for the Median: Example 14Example 14--16 Using the Template16 Using the Template
Note:Note: The template was used to help compute the test statistic and the p-value for the median test. First you must manually compute the number of values that are above the grand median and the number that is less than or equal to the grand median. Use these values in the template. See Table 14-16 in the text.
Since the p-value = 0.6703 is very large there is no evidence to reject the null hypothesis.