1. Nonparametric Methods and
Chi-Square Tests (1)
Slide 1
Shakeel Nouman
M.Phil Statistics
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
2. Slide 2
14 Nonparametric Methods and Chi-Square Tests (1)
• 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) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
3. Slide 3
14 Nonparametric Methods and Chi-Square Tests (2)
• 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 ChiSquare Test for Independence
A Chi-Square Test for Equality of
Proportions
Summary and Review of Terms
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
4. 14-1 Using Statistics
(Parametric Tests)
Slide 4
• Parametric Methods
Inferences 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
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
5. Nonparametric Tests
Slide 5
• Nonparametric Tests
Distribution-free methods making no assumptions about the
population distribution
Types 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 Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
6. Nonparametric Tests
(Continued)
Slide 6
• Nonparametric Tests
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
Spearman Rank Correlation Coefficient
Chi-Square Tests
•
•
•
Goodness of Fit
Testing for independence: Contingency Table Analysis
Equality of Proportions
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
7. Nonparametric Tests
(Continued)
•
•
•
Slide 7
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 Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
8. 14-2 Sign Test
Slide 8
• Comparing paired observations
Paired observations: X and Y
p = 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.50
H1: p 0.50
» Test statistic: T = Number of + signs
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
9. Sign Test Decision Rule
Slide 9
• Small Sample: Binomial Test
For 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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
11. Example 14-1- Using the
Template
Slide 11
H0: p = 0.5
H1: p 0.5
Test Statistic: T = 12
p-value = 0.0352.
For a = 0.05, the null hypothesis
is rejected since 0.0352 < 0.05.
Thus one can conclude that there
is a change in attitude toward a
CEO following the award of an
MBA degree.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
12. 14-3 The Runs Test - A Test for
Randomness
Slide 12
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
Case 2: SSSSSSSSSS|EEEEEEEEEE
Case 3: S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E
: R = 20 Apparently nonrandom
: R = 2 Apparently nonrandom
: R = 12 Perhaps random
A two-tailed hypothesis test for randomness:
H0: Observations are generated randomly
H1: 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) =
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
13. Runs Test: Examples
Table 8:
(n1,n2) 11
12
(10,10)
0.586 0.758 0.872 0.949 0.981 0.996 0.999 1.000 1.000 1.000
.
.
.
13
Number of Runs (r)
14
15
16
17
Slide 13
18
19
20
Case 1: n1 = 10 n2 = 10 R= 20 p-value
0
Case 2: n1 = 10 n2 = 10 R = 2 p-value
0
Case 3: n1 = 10 n2 = 10 R= 12
p-value R
P
F(11)]
= (2)(1-0.586) = (2)(0.414) = 0.828
H0 not rejected
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
14. Large-Sample Runs Test: Using
the Normal Approximation
Slide 14
The mean of the normal distribution of the number of runs:
2n n
E ( R)
1
n n
1
2
1
2
The standard deviation:
R
2n n ( 2n n n n )
( n n ) ( n n 1)
1
2
1
2
1
2
2
1
2
1
2
The standard normal test statistic:
R E ( R)
z
R
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
15. Large-Sample Runs Test:
Example 14-2
Slide 15
Example 14-2: n1 = 27 n2 = 26 R = 15
2n n
( 2)( 27)( 26)
E ( R) 1 2 1
1 26.49 1 27.49
n n
( 27 26)
1 2
2n n ( 2n n n n )
1 2 1 2 1 2 ( 2)( 27)( 26)(( 2)( 27)( 26) 27 26))
R
( n n ) 2 ( n n 1)
( 27 26) 2 ( 27 26 1)
1 2
1 2
1896804
12.986 3.604
146068
R E ( R ) 15 27.49
z
3.47
3.604
R
p - value = 2(1 - .9997) = 0.0006
H0 should be rejected at any common level of significance.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
16. Large-Sample Runs Test:
Example 14-2 – Using the
Template
Slide 16
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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
17. Using the Runs Test to Compare Two
Population Distributions (Means): the
Wald-Wolfowitz Test
Slide 17
The null and alternative hypotheses for the Wald-Wolfowitz test:
H0: The two populations have the same distribution
H1: 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
Example 14-3:
Salesperson A:
Salesperson B:
35 44
17 23
39
13
50
24
48
33
29
21
60
18
75
16
49
32
66
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
18. The Wald-Wolfowitz Test:
Example 14-3
Sales
35
44
39
48
60
75
49
66
17
23
13
24
33
21
18
16
32
Sales
Person
A
A
A
A
A
A
A
A
B
B
B
B
B
B
B
B
B
Sales
(Sorted)
13
16
17
21
24
29
32
33
35
39
44
48
49
50
60
66
75
Sales
Person
(Sorted)
B
B
B
B
B
A
B
B
A
A
A
A
A
A
A
A
A
Runs
1
2
3
Slide 18
n1 = 10 n2 = 9 R= 4
p-value PR 4
H0 may be rejected
Table
Number of Runs (r)
(n1,n2) 2
3
4
5
.
.
.
(9,10) 0.000 0.000 0.002 0.004 ...
4
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
19. Ranks Tests
Slide 19
• 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
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
20. 14-4 The Mann-Whitney U Test
(Comparing Two Populations)
Slide 20
The null and alternative hypotheses:
H0: The distributions of two populations are
identical
H1: The two population distributions are not
identical
The Mann-Whitney U statistic:
n1 ( n1 1)
U n1 n2
R1
2
R 1 Ranks from sample 1
where n1 is the sample size from population 1 and n2 is
the sample size from population 2.
n1 n2
n1 n2 (n1 n2 1)
E [U ]
U
2
12
U E [U ]
The large - sample test statistic: z
U
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
21. The Mann-Whitney U Test:
Example 14-4
Model
A
A
A
A
A
A
B
B
B
B
B
B
Time
35
38
40
42
41
36
29
27
30
33
39
37
Rank
5
8
10
12
11
6
2
1
3
4
9
7
Rank
Sum
U n1 n 2
n1 ( n1 1)
2
(6)(6 + 1)
= (6)(6) +
5
52
26
Slide 21
R1
52
2
Cumulative Distribution Function of the
Mann-Whitney U Statistic
n2=6
n1=6
u
.
.
.
4
0.0130
P(u
5)
5
0.0206
6
0.0325
.
.
.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
23. Slide 23
Example 14-5: Large-Sample
Mann-Whitney U Test – Using 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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
24. 14-5 The Wilcoxon SignedRanks Test (Paired Ranks)
Slide 24
The null and alternative hypotheses:
H0: The median difference between populations are 1 and 2 is zero
H1: 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: T min ( ), ( )
For small samples, a left-tailed test is used, using the values in Appendix C,
Table 10.
E[T ]
n ( n 1)
4
The large-sample test statistic:
n ( n 1)( 2 n 1)
T
24
z
T E[T ]
T
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
27. Example 14-7 using the
Template
Slide 27
Note 1: You should enter
the claimed value of the
mean (median) in every
used row of the second
column of data. In this case
it is 149.
Note 2: In order for the
large sample
approximations to be
computed you will need to
change n > 25 to n >= 25 in
cells M13 and M14.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
28. 14-6 The Kruskal-Wallis Test - A
Nonparametric Alternative to One-Way
ANOVA
Slide 28
The Kruskal-Wallis hypothesis test:
H0: All k populations have the same distribution
H1: Not all k populations have the same distribution
The Kruskal-Wallis test statistic:
2
12 k Rj
H
3(n 1)
n(n 1) n j
j 1
2
If each nj > 5, then H is approximately distributed as a .
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
30. Slide 30
Example 14-8: The Kruskal-Wallis
Test – Using the Template
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
31. Further Analysis (Pairwise
Comparisons of Average Ranks)
Slide 31
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:
D Ri R j
where R i is the mean of the ranks of the observations from
population i.
The critical point for the paired comparisons:
n(n 1) 1 1
2
C KW ( , k 1 )
ni n j
12
Reject if D > C KW
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
33. 14-7 The Friedman Test for a
Randomized Block Design
Slide 33
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 hypothesis test:
H0: The distributions of the k treatment populations are
identical
H1: Not all k distribution are identical
The Friedman test statistic:
12
R 3n(k 1)
nk (k 1)
2
k
j 1
2
j
The degrees of freedom for the chi-square distribution is (k – 1).
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
34. Example 14-10 – using the
Template
Slide 34
Note: The p-value
is small relative to
a significance level
of a = 0.05, so one
should conclude
that there is
evidence that not
all three lowbudget cruise lines
are equally
preferred by the
frequent cruiser
population
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
35. 14-8 The Spearman Rank
Correlation Coefficient
Slide 35
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):
n 2
6 di
rs 1 i 1
where d = R(x ) - R(y )
2
i
i
i
n ( n 1)
Null and alternative hypotheses:
H 0: s = 0
H1: s 0
Critical values for small sample tests from Appendix C, Table 11
Large sample test statistic:
z = rs ( n 1)
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
36. Slide 36
14 Nonparametric Methods and Chi-Square Tests (1)
• 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) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
37. Slide 37
14 Nonparametric Methods and Chi-Square Tests (2)
• 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 ChiSquare Test for Independence
A Chi-Square Test for Equality of
Proportions
Summary and Review of Terms
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
38. 14-1 Using Statistics
(Parametric Tests)
Slide 38
• Parametric Methods
Inferences 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
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
39. Nonparametric Tests
Slide 39
• Nonparametric Tests
Distribution-free methods making no assumptions about the
population distribution
Types 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 Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
40. Nonparametric Tests
(Continued)
Slide 40
• Nonparametric Tests
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
Spearman Rank Correlation Coefficient
Chi-Square Tests
•
•
•
Goodness of Fit
Testing for independence: Contingency Table Analysis
Equality of Proportions
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
41. Nonparametric Tests
(Continued)
•
•
•
Slide 41
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 Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
42. 14-2 Sign Test
Slide 42
• Comparing paired observations
Paired observations: X and Y
p = 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.50
H1: p 0.50
» Test statistic: T = Number of + signs
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
43. Sign Test Decision Rule
Slide 43
• Small Sample: Binomial Test
For 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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
45. Example 14-1- Using the
Template
Slide 45
H0: p = 0.5
H1: p 5
Test Statistic: T = 12
p-value = 0.0352.
For = 0.05, the null
hypothesis
is rejected since 0.0352 <
0.05.
Thus one can conclude
that there
is a change in attitude
toward a
CEO following the award
of an
MBA degree.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
46. 14-3 The Runs Test - A Test for
Randomness
Slide 46
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
Case 2: SSSSSSSSSS|EEEEEEEEEE
Case 3: S|EE|SS|EEE|S|E|SS|E|S|EE|SSS|E
: R = 20 Apparently nonrandom
: R = 2 Apparently nonrandom
: R = 12 Perhaps random
A two-tailed hypothesis test for randomness:
H0: Observations are generated randomly
H1: 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) =
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
47. Runs Test: Examples
Table 8:
(n1,n2)
11
12
(10,10)
0.586
0.758
.
.
.
Number of Runs (r)
13
14
0.872
0.949
Slide 47
15
16
17
18
19
20
0.981
0.996
0.999
1.000
1.000
1.000
Case 1: n1 = 10 n2 = 10 R= 20 p-value0
Case 2: n1 = 10 n2 = 10 R = 2 p-value 0
Case 3: n1 = 10 n2 = 10 R= 12
p-value PR 11F(11)]
= (2)(1-0.586) = (2)(0.414) = 0.828
H0 not rejected
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
48. Large-Sample Runs Test: Using
the Normal Approximation
Slide 48
The mean of the normal distribution of the number of runs:
2n n
E ( R)
1
n n
1
2
1
2
The standard deviation:
R
2n n ( 2n n n n )
( n n ) ( n n 1)
1
2
1
2
1
2
2
1
2
1
2
The standard normal test statistic:
R E ( R)
z
R
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
49. Large-Sample Runs Test:
Example 14-2
Slide 49
Example 14-2: n1 = 27 n2 = 26 R = 15
2n n
( 2)( 27)( 26)
E ( R) 1 2 1
1 26.49 1 27.49
n n
( 27 26)
1 2
2n n ( 2n n n n )
1 2 1 2 1 2 ( 2)( 27)( 26)(( 2)( 27)( 26) 27 26))
R
( n n ) 2 ( n n 1)
( 27 26) 2 ( 27 26 1)
1 2
1 2
1896804
12.986 3.604
146068
R E ( R ) 15 27.49
z
3.47
3.604
R
p - value = 2(1 - .9997) = 0.0006
H0 should be rejected at any common level of significance.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
50. Large-Sample Runs Test:
Example 14-2 – Using the
Template
Slide 50
Note: The
computed pvalue 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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
51. Using the Runs Test to Compare Two
Population Distributions (Means): the
Wald-Wolfowitz Test
Slide 51
The null and alternative hypotheses for the Wald-Wolfowitz test:
H0: The two populations have the same distribution
H1: 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
Example 14-3:
Salesperson A:
Salesperson B:
35
17
44
23
39
13
50
24
48
33
29
21
60
18
75
16
49
32
66
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
52. The Wald-Wolfowitz Test:
Example 14-3
Sales
35
44
39
48
60
75
49
66
17
23
13
24
33
21
18
16
32
Sales
Person
A
A
A
A
A
A
A
A
B
B
B
B
B
B
B
B
B
Sales
(Sorted)
13
16
17
21
24
29
32
33
35
39
44
48
49
50
60
66
75
Sales
Person
(Sorted)
B
B
B
B
B
A
B
B
A
A
A
A
A
A
A
A
A
Runs
1
2
3
Slide 52
n1 = 10 n2 = 9 R= 4
p-value PR 4
H0 may be rejected
Table
Number of Runs (r)
(n1,n2) 2
3
4
5
.
.
.
(9,10) 0.000 0.000 0.002 0.004 ...
4
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
53. Ranks Tests
Slide 53
• 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
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
54. 14-4 The Mann-Whitney U Test
(Comparing Two Populations)
Slide 54
The null and alternative hypotheses:
H0: The distributions of two populations are identical
H1: The two population distributions are not identical
The Mann-Whitney U statistic:
n1 ( n1 1)
U n1 n2
R1
R 1 Ranks from sample 1
2
where n1 is the sample size from population 1 and n2 is the
sample size from population 2.
n1 n2
n1 n2 (n1 n2 1)
E [U ]
U
2
12
U E [U ]
The large - sample test statistic: z
U
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
55. The Mann-Whitney U Test:
Example 14-4
Model
A
A
A
A
A
A
B
B
B
B
B
B
Time
35
38
40
42
41
36
29
27
30
33
39
37
Rank
5
8
10
12
11
6
2
1
3
4
9
7
Rank
Sum
U n1 n 2
n1 ( n1 1)
2
(6)(6 + 1)
= (6)(6) +
5
52
26
Slide 55
R1
52
2
Cumulative Distribution Function of the
Mann-Whitney U Statistic
n2=6
n1=6
u
.
.
.
4
0.0130
Pu5
5
0.0206
6
0.0325
.
.
.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
57. Slide 57
Example 14-5: Large-Sample
Mann-Whitney U Test – Using 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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
58. 14-5 The Wilcoxon SignedRanks Test (Paired Ranks)
Slide 58
The null and alternative hypotheses:
H0: The median difference between populations are 1 and 2 is zero
H1: 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: ( ), ( )
T min
For small samples, a left-tailed test is used, using the values in Appendix C,
Table 10.
E[T ]
n ( n 1)
4
The large-sample test statistic: z
T
T E[T ]
n ( n 1)( 2 n 1)
24
T
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
61. Example 14-7 using the
Template
Slide 61
Note 1: You should enter
the claimed value of the
mean (median) in every
used row of the second
column of data. In this
case it is 149.
Note 2: In order for the
large sample
approximations to be
computed you will need
to change n > 25 to n >=
25 in cells M13 and M14.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
62. 14-6 The Kruskal-Wallis Test - A
Nonparametric Alternative to One-Way
ANOVA
Slide 62
The Kruskal-Wallis hypothesis test:
H0: All k populations have the same distribution
H1: Not all k populations have the same distribution
The Kruskal-Wallis test statistic:
2
12 k Rj
H
n 3(n 1)
n(n 1) j 1 j
If each nj > 5, then H is approximately distributed as a 2.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
64. Slide 64
Example 14-8: The Kruskal-Wallis
Test – Using the Template
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
65. Further Analysis (Pairwise
Comparisons of Average Ranks)
Slide 65
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:
D Ri R j
where R i is the mean of the ranks of the observations from
population i.
The critical point for the paired comparisons:
n(n 1) 1 1
2
C KW ( , k 1 )
ni n j
12
Reject if D > C KW
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
67. 14-7 The Friedman Test for a
Randomized Block Design
Slide 67
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 hypothesis test:
H0: The distributions of the k treatment populations are identical
H1: Not all k distribution are identical
The Friedman test statistic:
12
R 3n(k 1)
nk (k 1)
The degrees of freedom for the chi-square distribution is (k – 1).
2
k
j 1
2
j
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
68. Example 14-10 – using the
Template
Slide 68
Note: The pvalue 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
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
69. 14-8 The Spearman Rank
Correlation Coefficient
Slide 69
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):
n 2
6 di
rs 1 i 1
where d = R(x ) - R(y )
2
i
i
i
n ( n 1)
Null and alternative hypotheses:
H 0: s = 0
H1: s 0
Critical values for small sample tests from Appendix C, Table 11
Large sample test statistic:
z = rs ( n 1)
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
71. Spearman Rank Correlation
Coefficient: Example 14-11
Using the Template
Slide 71
Note: The pvalues in the
range J15:J17
will appear only
if the sample
size is large (n
> 30)
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
72. 14-9 A Chi-Square Test for
Goodness of Fit
Slide 72
Steps in a chi-square analysis:
Formulate null and alternative hypotheses
Compute frequencies of occurrence that would be
expected if the null hypothesis were true - expected cell
counts
Note actual, observed cell counts
Use differences between expected and actual cell counts
to find chi-square statistic:
(Oi Ei ) 2
2
Ei
i 1
k
Compare chi-statistic with critical values from the chisquare distribution (with k-1 degrees of freedom) to test
the null hypothesis
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
73. Example 14-12: Goodness-of-Fit
Test for the Multinomial
Distribution
Slide 73
The null and alternative hypotheses:
H0: The probabilities of occurrence of events E1, E2...,Ek are given by
p1,p2,...,pk
H1: 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=80
Preference
Tan
Brown Maroon Black
Total
Observed
12
40
8
20
80
Expected(np)
20
20
20
20
80
(O-E)
-8
20
-12
0
0
k ( Oi E i )
2
i 1
Ei
2
( 8 )
20
2
( 20 )
2
( 12 )
20
20
2
( 0)
2
20
30.4
2
11.3449
( 0.01, 3)
H 0 is rejected at the 0.01 level.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
74. Slide 74
Example 14-12: Goodness-of-Fit
Test for the Multinomial
Distribution using the Template
Note: the pvalue is
0.0000, so we
can reject the
null
hypothesis at
any a level.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
75. Goodness-of-Fit for the Normal
Distribution: Example 14-13
p(z<-1)
p(-1<z<-0.44)
p(-0.44<z<0)
p(0<z<0.44)
p(0.44<z<14)
p(z>1)
= 0.1587
= 0.1713
= 0.1700
= 0.1700
= 0.1713
= 0.1587
Partitioning the Standard Normal Distribution
0.1700
0.1700
0.4
0.1713
0.1713
0.3
f(z)
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.
Slide 75
0.2
0.1587
0.1587
0.1
z
0.0
-5
-1
0
1
5
-0.44 0.44
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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
76. Example 14-13: Solution
i
Oi
Ei
1
2
3
4
5
6
14 15.87
20 17.13
16 17.00
19 17.00
16 17.13
15 15.87
Slide 76
Oi - Ei (Oi - Ei)2 (Oi - Ei)2/ Ei
-1.87
2.87
-1.00
2.00
-1.13
-0.87
3.49690
8.23691
1.00000
4.00000
1.27690
0.75690
2
:
0.22035
0.48085
0.05882
0.23529
0.07454
0.04769
1.11755
2(0.10,k-3)= 6.5139 > 1.11755 H0 is not rejected at the 0.10 level
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
77. Example 14-13: Solution using
the Template
Slide 77
Note: p-value =
0.8002 > 0.01
H0 is not
rejected at the
0.10 level
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
78. 14-9 Contingency Table
Analysis:
A Chi-Square Test for
Independence
Slide 78
First Classification Category
Second
Classification
Category
1
2
3
4
5
Column
Total
1
O11
O21
O31
O41
O51
2
O12
O22
O32
O42
O52
3
O13
O23
O33
O43
O53
4
O14
O24
O34
O44
O54
5
O15
O25
O35
O45
O55
C1
C2
C3
C4
C5
Row
Total
R1
R2
R3
R4
R5
n
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
79. Contingency Table Analysis:
A Chi-Square Test for Independence
Slide 79
A and B are independent if:P(AUB) = P(A)P(B).
If the first and second classification categories are independent:Eij = (Ri)(Cj)/
Null and alternative hypotheses:
H0: The two classification variables are independent of each
other
H1: The two classification variables are not independent
( Oij Eij ) 2
Eij
i 1 j 1
r
Chi-square test statistic for independence:
2
c
Degrees of freedom: df=(r-1)(c-1)
Expected cell count:
Ri C j
Eij
n
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
80. Contingency Table Analysis:
Example 14-14
Industry Type
Profit
Service Nonservice
(Expected) (Expected) Total
42
18
60
(Expected)
Loss
6
(Expected)
(40*48/100)=19.2
Total
ij
11
12
21
22
(60*48/100)=28.8
48
O
42
18
6
34
E
28.8
31.2
19.2
20.8
O-E
13.2
-13.2
-13.2
13.2
(O-E)2
174.24
174.24
174.24
174.24
2:
Slide 80
2(0.01,(2-1)(21))=6.63490
H0 is rejected at
the 0.01 level
(60*52/100)=31.2
and
34
40
(40*52/100)=20.8
it is concluded
52
100
that the two
variables
2
(O-E) /E
Yates corrected for a 2x2 table:
are not
6.0500
2
independent.
5.5846
O E 0.5
29.0865
2
9.0750
8.3769
2
ij
ij
Eij
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
81. Contingency Table Analysis: Slide 81
Example 14-14 using the Template
Note: When
the
contingenc
y table is a
2x2, one
should use
the Yates
correction.
Since p-value = 0.000, H0 is rejected at the 0.01 level and it is concluded that the two
variables are not independent.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
82. 14-11 Chi-Square Test for
Equality
of Proportions
Slide 82
Tests of equality of proportions across several populations
are also called 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 = … = pc
H1: Not all pi, I = 1, 2, …, c, are equal
Chi-square test statistic for equal proportions:
( Oij Eij ) 2
2
Eij
i 1 j 1
r
c
Degrees of freedom: df = (r-1)(c-1)
Expected cell count:
Ri C j
Eij
n
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
83. 14-11 Chi-Square Test for
Equality
of Proportions - Extension
Slide 83
The Median Test
Here, the Null and alternative hypotheses are:
H0: The c populations have the same median
H1: Not all c populations have the same median
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
84. Chi-Square Test for the Median:
Example 14-16 Using the
Template
Slide 84
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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
86. Spearman Rank Correlation
Coefficient: Example 14-11
Using the Template
Slide 86
Note: The pvalues in the
range J15:J17
will appear only
if the sample
size is large (n
> 30)
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
87. 14-9 A Chi-Square Test for
Goodness of Fit
Slide 87
Steps in a chi-square analysis:
Formulate null and alternative hypotheses
Compute frequencies of occurrence that would be
expected if the null hypothesis were true - expected cell
counts
Note actual, observed cell counts
Use differences between expected and actual cell counts
to find chi-square statistic:
(Oi Ei ) 2
Ei
i 1
k
2
Compare chi-statistic with critical values from the chisquare distribution (with k-1 degrees of freedom) to test
the null hypothesis
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
88. Example 14-12: Goodness-of-Fit
Test for the Multinomial
Distribution
Slide 88
The null and alternative hypotheses:
H0: The probabilities of occurrence of events E1, E2...,Ek are
given by
p1,p2,...,pk
H1: 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=80
Preference
Tan
Brown Maroon Black
Total
Observed
12
40
8
20
80
Expected(np)
20
20
20
20
80
(O-E)
-8
20
-12
0
0
k ( Oi E i )
2
i 1
Ei
2
( 8 )
20
2
( 20 )
2
( 12 )
20
20
2
( 0)
2
20
30.4
2
11.3449
( 0.01, 3)
H 0 is rejected at the 0.01 level.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
89. Slide 89
Example 14-12: Goodness-of-Fit
Test for the Multinomial
Distribution using the Template
Note: the pvalue is
0.0000, so
we can
reject the
null
hypothesis
at any
level.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
90. Goodness-of-Fit for the Normal
Distribution: Example 14-13
p(z<-1)
p(-1<z<-0.44)
p(-0.44<z<0)
p(0<z<0.44)
p(0.44<z<14)
p(z>1)
= 0.1587
= 0.1713
= 0.1700
= 0.1700
= 0.1713
= 0.1587
Partitioning the Standard Normal Distribution
0.1700
0.1700
0.4
0.1713
0.1713
0.3
f(z)
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.
Slide 90
0.2
0.1587
0.1587
0.1
z
0.0
-5
-1
0
1
5
-0.44 0.44
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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
91. Example 14-13: Solution
i
1
2
3
4
5
6
Oi
14
20
16
19
16
15
Ei
15.87
17.13
17.00
17.00
17.13
15.87
Slide 91
Oi - Ei (Oi - Ei)2 (Oi - Ei)2/ Ei
-1.87
2.87
-1.00
2.00
-1.13
-0.87
3.49690
8.23691
1.00000
4.00000
1.27690
0.75690
2
:
0.22035
0.48085
0.05882
0.23529
0.07454
0.04769
1.11755
2(0.10,k-3)= 6.5139 > 1.11755 H0 is not rejected at the 0.10 level
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
92. Example 14-13: Solution using
the Template
Slide 92
Note: p-value =
0.8002 > 0.01
H0 is not
rejected at the
0.10 level
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
93. 14-9 Contingency Table Analysis:
A Chi-Square Test for Independence
Slide 93
First Classification Category
Second
Classification
Category
1
2
3
4
5
Column
Total
1
O11
O21
O31
O41
O51
2
O12
O22
O32
O42
O52
3
O13
O23
O33
O43
O53
4
O14
O24
O34
O44
O54
5
O15
O25
O35
O45
O55
C1
C2
C3
C4
C5
Row
Total
R1
R2
R3
R4
R5
n
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
94. Contingency Table Analysis:
A Chi-Square Test for
Independence
Slide 94
A and B are independent if:P(AUB) = P(A)P(B).
If the first and second classification categories are independent:Eij = (Ri)(Cj)/
Null and alternative hypotheses:
H0: The two classification variables are independent of each other
H1: The two classification variables are not independent
Chi-square test statistic for independence:
( Oij Eij ) 2
2
Eij
i 1 j 1
r
Degrees of freedom: df=(r-1)(c-1)
Expected cell count:
c
Ri C j
Eij
n
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
95. Contingency Table Analysis:
Example 14-14
2(0.01,(2-1)(21))=6.63490
Industry Type
Profit
Service Nonservice
(Expected) (Expected) Total
42
18
60
(Expected)
6
34
(Expected)
(40*48/100)=19.2
(40*52/100)=20.8
Total
48
52
H0 is rejected at the
0.01 level and
it is concluded that
the two variables
are not independent.
(60*52/100)=31.2
Loss
ij
11
12
21
22
(60*48/100)=28.8
O
42
18
6
34
E
28.8
31.2
19.2
20.8
(O-E)2
174.24
174.24
174.24
174.24
O-E
13.2
-13.2
-13.2
13.2
2:
29.0865
(O-E)2/E
6.0500
5.5846
9.0750
8.3769
Slide 95
40
100
2
Yates corrected for a 2x2 table:
2
Oij Eij 0.5
2
Eij
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
96. Contingency Table Analysis: Slide 96
Example 14-14 using the Template
Note: When
the
contingenc
y table is a
2x2, one
should use
the Yates
correction.
Since p-value = 0.000, H0 is rejected at the 0.01 level and it is concluded that the two
variables are not independent.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
97. 14-11 Chi-Square Test for
Equality
of Proportions
Slide 97
Tests of equality of proportions across several populations
are also called 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 = … = pc
H1: Not all pi, I = 1, 2, …, c, are equal
Chi-square test statistic for equal proportions:
( Oij Eij ) 2
2
Eij
i 1 j 1
r
c
Degrees of freedom: df = (r-1)(c-1)
Expected cell count:
Ri C j
Eij
n
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
98. 14-11 Chi-Square Test for Equality
of Proportions - Extension
Slide 98
The Median Test
Here, the Null and alternative hypotheses are:
H0: The c populations have the same median
H1: Not all c populations have the same median
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
99. Chi-Square Test for the Median:
Example 14-16 Using the Template
Slide 99
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.
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer
100. Name
Religion
Domicile
Contact #
E.Mail
M.Phil (Statistics)
Shakeel Nouman
Christian
Punjab (Lahore)
0332-4462527. 0321-9898767
sn_gcu@yahoo.com
sn_gcu@hotmail.com
Slide 100
GC University, .
(Degree awarded by GC University)
M.Sc (Statistics)
Statitical Officer
(BS-17)
(Economics & Marketing
Division)
GC University, .
(Degree awarded by GC University)
Livestock Production Research Institute
Bahadurnagar (Okara), Livestock & Dairy Development
Department, Govt. of Punjab
Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman M.Phil Statistics Govt. College University Lahore, Statistical
Officer