Download 1 NONPARAMETRIC STATISTICS (adapted from J. Hurley notes

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
Transcript
NONPARAMETRIC STATISTICS
(adapted from J. Hurley notes)
Nonparametric statistics are useful when inferences must be made on ordinal data, the
assumption of normality is not appropriate, and for small samples.
Advantages:
1. Easy application.
2. Can serve as a quick procedure for evaluation, in order to determine whether or
not further analysis is required.
3. Many assumptions typically required concerning the population of the data source
can be relaxed.
4. Useful when the assumption of normality can not be made, but population is
continuous.
The Sign Test:
The sign test may be used as an alternative to a one-sample t-test for a population mean.
While the t-test requires the sample to come from a normal population, this is not the case
for the sign test. The sign test is used to test hypothesis about the median of a continuous
distribution.
This test may also be used to compare two populations based on paired data.
Example – Sign Test for a Population Median (small sample n<10):
If dealing with a small sample that is not normally distributed, the Sign Test should be
used instead of the t-test for the mean. The Sign Test actually tests hypothesis about the
median of any continuous population.
Ho: µ˜ = µ˜ 0
µ˜ > µ˜ 0
Ha: µ˜ ≠ µ˜ 0
µ˜ < µ˜ 0
T.S.: S = number of sample observations greater than µ˜ 0
S = larger of S1 and S2 (where S1 is # observations > µ˜ 0 , S2 is # observations < µ˜ 0 )
S = number of sample observations less than µ˜ 0
(Select S depending on which alternative you are testing)
RR:
p-value = P(x≥S), where x has a binomial distribution with parameters n and p=0.5
Reject if selected α > p-value (use Table II, Appendix A to find p-value)
CIVL 7012/8012 Probabilistic Methods for Engineers
1
Ex.
Water management engineers have determined that the percentages of active bacteria in
sewage specimens collected at a particular plant have a distribution with a median of 40
%. If the median percentage is large than 40, then adjustments in the sewage treatment
process must be made. The percentages of active bacteria in a random sample of 10
sewage specimens are listed below. Do the data provide sufficient evidence to indicate
that the median percentage of active bacteria in sewage specimens is greater than 40?
Test using α = 0.05.
41
33
43
52
46
37
44
49
53
30
Example- Sign Test for Paired Data:
We evaluate the test statistic based on the number of sample pairs for which the
observation in Population 1 is larger than the corresponding observation from Population
2.
If the two distributions are the same, we would expect that half of these differences
would be greater than zero and half less than zero (not considering those where the
difference is exactly zero).
Ho: p (proportion of signs is = 0.5 (the distributions are identical)
Ha: p ≠ 0.5;
p > 0.5 (the distribution for population 1 is to the right of that for population 2);
p < 0.5 (the distribution for population 1 is to the left of that for population 2).
CIVL 7012/8012 Probabilistic Methods for Engineers
2
T.S. (valid for large samples with n ≥ 10)
where y = # of positive differences
n = # of sign differences
Rejection Region:
Example:
Fifteen judges were asked to rate leaf samples from two different varieties of tobacco on
a scale of 1 to 5 points. Use the data given below to test the hypothesis that the
distribution of ratings are different for the two varieties of tobacco. Use α = 0.05.
Judge
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Variety 1
1
4
4
2
4
5
5
4
5
3
4
2
4
5
4
CIVL 7012/8012 Probabilistic Methods for Engineers
Variety 2
2
3
3
1
3
4
3
2
3
1
4
3
2
3
3
Sign of Difference
3
Wilcoxon’s Signed Rank Test:




For symmetric, continuous distributions (thus we can test about the mean);
An alternative to t-tests for tests about a mean (or median since symmetric) or for
paired samples;
Makes use of the sign and magnitude of the rank of the differences between pairs
of measurements;
Using the number of pairs of measurements with a nonzero difference, the
differences are ranked from lowest to highest, ignoring their signs. If two or more
measurements have the same nonzero difference (ignoring sign), each difference
is assigned a rank equal to the average of the occupied ranks. The appropriate
sign is then attached to the rank of each difference.
Example:
#
+32
-32
Rank
6
7
would be
Rank
+6.5
-6.5
Notation:
n = the number of pairs of observations with a nonzero difference
T+ = the sum of the positive ranks
T- = the sum of the negative ranks
T = the smaller of T+ and T-, ignoring their signs
Ex. Large-Sample Wilcoxon Signed-Rank Test for hypothesis about a mean: (valid for
sample size > 20)
µT =
If all differences with the same rank are grouped together and there are g such groups, the
variance of T is:
where tj is the number of tied ranks in group j. If there are no tied ranks, g = n and tj = 1
for all groups. The variance of T then becomes:
Ho: The distributions are identical
Ha: The two distributions are different
CIVL 7012/8012 Probabilistic Methods for Engineers
4
T.S.
R.R. For a specified value of α, reject Ho if:
Small-Sample Wilcoxon Signed-Rank Test: (valid for sample size ≤ 20)
Ho: The distributions are identical
Ha: The two distributions are different
T.S.: T
R.R.: For a specified value of α and sample size n, if T is less than or equal to the table
value (Table IX, Appendix A) reject Ho.
These procedures can also be used for one-tailed tests.
CIVL 7012/8012 Probabilistic Methods for Engineers
5
Example:
Two different brands of fertilizer (A and B) were compared on each of 10 different twoacre plots. Each plot was subdivided into one-acre subplots, with Brand A randomly
assigned to one subplot and Brand B to the other. Fertilizers were then applied to the
subplots at the rate of 60 pounds per acre. The data, barley yields in bushels per acre, are
listed below by fertilizer and plot.
Plot
1
2
3
4
5
6
7
8
9
10
Fertilizer A
y1
312
333
356
316
310
352
389
313
316
346
Fertilizer B
y2
346
372
392
351
330
364
375
315
327
378
Difference
(y1-y2)
-34
-39
-36
-35
-20
-12
14
-2
-11
-32
Ranked
Differences
Assign Signs
Use the Wilcoxon signed-rank test to test the hypothesis that the distributions of barley
yields for the two brands of fertilizer are identical against the alternative that they are
different. Use α = 0.05.
CIVL 7012/8012 Probabilistic Methods for Engineers
6
Wilcoxon’s Rank Sum Test:




More powerful (efficient) than Wilcoxon’s Signed-Rank or Sign Test (compares
entire distributions, not just medians).
Equivalent to Mann-Whitney U test.
The similarity between the samples is measured by jointly ranking (from lowest to
highest) the measurements from the combined samples and examining the sum of
the ranks for sample 1.
For ties among the combined sample measurements, each measurement is
assigned a rank equal to the average of the occupied ranks, as in the procedure for
the Wilcoxon Signed-Rank test.
Example: Wilcoxon’s Rank Sum Test for Small Samples (n<8-10)
Ho: The two populations are identical
Ha: The two populations are different (µ1 ≠ µ2).
T.S.
W1 or W2
(n + n 2 )(n1 + n 2 + 1)
W2 = 1
− W1
2
Where:
W1 is the sum of the ranks in the smaller sample
W2 is the sum of the ranks in the larger sample
n1 is the number of observations in the smaller sample
n2 is the number of observations in the larger sample
R.R.: For a specified value of α, reject Ho if:
W1 or W2 ≤ Wilcoxon Rank Sum critical value (Table X, Appendix A)
For large samples, W1 approximately follows the normal distribution. The test is
valid provided n1 > 8-10 and n2 > 8-10. (see note in Table X, Appendix A)
Example:
Environmental engineers were interested in determining whether a cleanup project on
a nearby lake was effective. One indicator of effectiveness would be a decrease in
dissolved oxygen over a period of time. Prior to initiation of the project, 12 samples
of water had been obtained at random from the lake and analyzed for the amount of
dissolved oxygen (in ppm). Due to diurnal fluctuations in the dissolved oxygen, all
measurements were obtained at the 2 P.M. peak period. Similar data were taken six
months after the initation of the cleanup project. The before and after data are
presented below. Use α = 0.05 to test the following hypothesis:
CIVL 7012/8012 Probabilistic Methods for Engineers
7
Ho: µ1 = µ2
Ha: µ1 ≠ µ2
Before Cleanup
11.0
11.2
11.2
11.2
11.4
11.5
11.6
11.7
11.8
11.9
11.9
12.1
Rank
CIVL 7012/8012 Probabilistic Methods for Engineers
After Cleanup
10.2
10.3
10.4
10.6
10.6
10.7
10.8
10.8
10.9
11.1
11.1
11.3
Rank
8
The Runs (Wald-Wolfowitz) Test
This test can be used to determine whether or not two samples were obtained from
different distributions.
This test may also be used for determining whether or not events occur in random order.
In the runs test, a sequence of events is classified as successes (S) and failures (F).
Example: Small Sample Runs Test for Randomness
Suppose that the following sequence of successes and failures occurred:
SSFFSSSSFFFSSSS
We want to answer the question, “Is there evidence to indicate non-randomness in the
sequence?” A run is defined as a series of like events, with the first and last elements
being preceded and followed, respectively, by unlike events. For the series above, the
runs breakdown is as followed:
SS FF FFFF FFF SSSS
Thus, there are 5 runs in the sequence. You may expect non-randomness if you find
either a large number of runs or an extremely small number of runs.
Notation:
r = the number of runs in a sequence
n1, n2 = the number of successes and failures, respectively
For small sample sizes where n1 ≤ n2 and both are no more than 10-20, the attached table
at the end of this handout gives the probability that r is less than or equal to a specified
value, l.
Example:
a.)
For n1 = 3 successes and n2 = 9 failures, the probability that r ≤ 2 is 0.009.
b.)
For n1 = n2 = 8, the probability that r ≥ 8 is:
1 – P(r ≤ 7)) = 1 – 0.214 = 0.786
Hypothesis Test:
Ho: the sequence is a random arrangement of successes and failures.
Ha: the sequence is not a random arrangement of successes and failures.
Test Statistic:
r = , the observed number of runs
CIVL 7012/8012 Probabilistic Methods for Engineers
9
R.R.
For a two-tailed test with a given combination of (n1, n2) and α, we must find both P(r ≤
) and P(r ≥ ). If either of these probabilities is less than or equal to α/2, we reject Ho.
For a one-tailed test we place all of the rejection region in one tail of the distribution of r.
Example:
The data below is a sequence of successes and failures for car inspections. Is there
sufficient reason to believe that the sequence is not random? Use α= 0.05.
SSFFSSSFFFSSSS
The sequence has 10 successes, 5 failures, and r = 5 runs. Assume we wish to perform a
one-tailed test for determining an extremely large number of runs (which would indicate
that the two inspectors are not using the same criteria for judging cars). The rejection
region, then, will be in the upper tail of the distribution of r. From the attached table for
the (5, 10) combination, we find:
P(r ≥ 5) = 1.0 - 029 = 0.971
This is certainly not less than α = 0.05. There is insufficient evidence, then, to indicate a
lack of randomness in the sequence.
Example: Large Sample Runs Test for Randomness
Where n1 and n2 are both more than 10-20, r is approximately normally distributed with:
We can now use a z test with:
CIVL 7012/8012 Probabilistic Methods for Engineers
10
CIVL 7012/8012 Probabilistic Methods for Engineers
11