SlideShare a Scribd company logo
Nonparametric
  Statistics
In previous testing, we assumed that our samples were drawn
from normally distributed populations.
This chapter introduces some techniques that do not make
that assumption.
These methods are called distribution-free or nonparametric
tests.
In situations where the normal assumption is appropriate,
nonparametric tests are less efficient than traditional
parametric methods.
Nonparametric tests frequently make use only of the order of
the observations and not the actual values.
In this section, we will discuss four nonparametric tests:
the Wilcoxon Rank Sum Test (or Mann-Whitney U test),
the Wilcoxon Signed Ranks Test,
the Kruskal-Wallis Test, and
the one sample test of runs.
The Wilcoxon Rank Sum Test
            or Mann-Whitney U Test
This test is used to test whether 2 independent samples have
been drawn from populations with the same median.
It is a nonparametric substitute for the t-test on the difference
between two means.
Wilcoxon Rank Sum Test Example:

 university    Based on the following samples from
A         B    two universities, test at the 10% level
50       70    whether graduates from the two
52       73    schools have the same average grade
56       77    on an aptitude test.
60       80
64       83
68       85
71       87
74       88
89       96
95       99
First merge and rank the grades.   rank   grade   university
Sum the ranks for each sample.      1      50         A

rank sum for university A: 74       2      52         A

rank sum for university B: 136      3      56         A
                                    4      60         A
       university                   5      64         A
                                    6      68         A        Note: If there are
      A         B
                                    7      70         B        ties, each value
      50        70                  8      71         A        gets the average
      52        73                  9      73         B        rank. For example,
                                   10      74         A        if 2 values tie for
      56        77
                                   11      77         B        3th and 4th place,
      60        80                                             both are ranked
                                   12      80         B
      64        83                 13      83         B
                                                               3.5. If three
                                                               differences would
      68        85                 14      85         B
                                   15      87         B
                                                               be ranked 7, 8, and
      71        87                                             9, rank them all 8.
                                   16      88         B
      74        88                 17      89         A

      89        96                 18      95         A
                                   19      96         B
      95        99
                                   20      99         B
Here, the group from university A is considered the 1st sample.
  When the samples differ in size, designate the smaller of the
  2 samples as the 1st sample.
    Define T1 = sum of the ranks for 1st sample .

                                     n1 (n1 + n2 + 1)
      The mean of T1 is µT1 =                         ,
                                            2
                                               n1n 2 (n1 + n2 + 1)
       and the standard deviation is σ T1 =                        .
                                                       12

      If n1 and n 2 are each at least 10, T1 is approximately normal.

                T1 - µT1
     So, Z =               has a standard normal distribution.
                  σ T1
(For small sample sizes, the Z approximation is sometimes used as well.)
For our example, T1 = 74.
           n1 (n + 1) 10(20 + 1)
     µT1 =           =           = 105
               2          2

               n1n 2 (n + 1)     (10)(10)(20 + 1)
     σ T1 =                  =                    = 13.229
                    12                 12

         T1 - µT1         74 - 105
   Z =                =            = -2.343.
              σ T1        13.229

Since the critical values for a
2-tailed Z test at the 10%
level are 1.645 and -1.645, we             critical                                  critical
                                           region                                    region
reject H0 that the medians are                              .45       .45
the same and accept H1 that                           .05                      .05

the medians are different.                            -1.645      0         1.645           Z
For small sample sizes, you can use Table E.8 in
your textbook, which provides the lower and upper
critical values for the Wilcoxon Rank Sum Test.
That table shows that for our 10% 2-tailed test, the
  lower critical value is 82 and the upper critical value
  is 128.
Since our smaller sample’s rank sum is 74, which is
  outside the interval (82, 128) indicated in the table,
  we reject the null hypothesis that the medians are
  the same and conclude that they are different.
Equivalently, since the larger sample’s rank sum is
  136, which is also outside the interval (82, 128), we
  again reject the null hypothesis that the medians are
  the same and conclude that they are different.
The Wilcoxon Signed Rank Test
This test is used to test whether 2 dependent samples have
been drawn from populations with the same median.
It is a nonparametric substitute for the paired t-test on the
difference between two means.
Wilcoxon Signed Rank Test Procedure
1.   Calculate the differences in the paired values (Di=X1i – X2i)
2.   Take absolute values of the differences and rank them (Discard
     all differences that equal 0.)
3.   Assign ranks Ri with the smallest rank equal to 1.
     As in the rank sum test, if two or more of the differences are
     equal, each difference gets the average rank. (That is, if two
     differences would be ranked 3 and 4, rank them both 3.5. If
     three differences would be ranked 7, 8, and 9, rank them all 8.)
4.   Assign the symbol + to positive differences and – to negative
     differences.
5.   Calculate the Wilcoxon statistic W as the sum of the positive
     ranks. So,
                      W=   ∑   Ri+
Wilcoxon Signed Rank Test Procedure (cont’d)
In the following, n refers to the number of non - zero differences.
                                                          n(n + 1)
 The mean of the Wilcoxon statistic W is             µW =
                                                             4
 The standard deviation of the Wilcoxon statistic W is
                                  n(n + 1)(2n + 1)
                          σW =
                                         24

If n is at least 20, the test statistic W is approximately normal. So we have :

                                   W − µW
                              Z=
                                      σW
(For small sample sizes, the Z approximation is sometimes used as well.)
diff     rank   rank                      diff     rank   rank
                     exam1   exam2                             exam1   exam2
                                     (ex2-ex1)    (+)    (-)                   (ex2-ex1)    (+)    (-)

     Example          95      97                                72      68

Suppose we have       76      76                                78      94
a class with 22       82      75                                58      55
students, each of
whom has two          48      54                                73      75

exam grades.          27      31                                71      70

We want to test at    34      39                                69      66
the 5% level
                      58      61                                57      62
whether there is a
difference in the     98      97                                84      92
median grade for      45      45                                91      81
the two exams.
                      77      94                                83      90

                      27      36                                67      73
diff     rank   rank                      diff     rank   rank
                         exam1   exam2                             exam1   exam2
                                         (ex2-ex1)    (+)    (-)                   (ex2-ex1)    (+)    (-)

We calculate the          95      97        2                       72      68        -4
difference between the
exam grades:              76      76        0                       78      94       16
diff = exam2 – exam 1.
                          82      75        -7                      58      55        -3

                          48      54        6                       73      75        2

                          27      31        4                       71      70        -1

                          34      39        5                       69      66        -3

                          58      61        3                       57      62        5

                          98      97        -1                      84      92        8

                          45      45        0                       91      81       -10

                          77      94       17                       83      90        7

                          27      36        9                       67      73        6
diff     rank   rank                      diff     rank   rank
                         exam1   exam2                             exam1   exam2
Then we rank the                         (ex2-ex1)    (+)    (-)                   (ex2-ex1)    (+)    (-)

absolute values of the    95      97        2                       72      68        -4
differences from
smallest to largest,      76      76        0                       78      94       16

omitting the two zero     82      75        -7                      58      55        -3
differences.
                          48      54        6                       73      75        2
The smallest non-zero
|differences| are the     27      31        4                       71      70        -1              1.5
two |-1|’s. Since they    34      39        5                       69      66        -3
are tied for ranks 1
and 2, we rank them       58      61        3                       57      62        5
both 1.5.
                          98      97        -1              1.5     84      92        8
Since the differences
                          45      45        0                       91      81       -10
were negative, we put
the ranks in the          77      94       17                       83      90        7
negative column.
                          27      36        9                       67      73        6
diff     rank   rank                      diff     rank   rank
                          exam1   exam2                             exam1   exam2
                                          (ex2-ex1)    (+)    (-)                   (ex2-ex1)    (+)    (-)

The next smallest          95      97        2        3.5            72      68        -4
non-zero |differences|
                           76      76        0                       78      94       16
are the two |2|’s.
Since they are tied for    82      75        -7                      58      55        -3
ranks 3 and 4, we
                           48      54        6                       73      75        2        3.5
rank them both 3.5.
Since the differences      27      31        4                       71      70        -1              1.5

were positive, we put      34      39        5                       69      66        -3
the ranks in the
positive column.           58      61        3                       57      62        5

                           98      97        -1              1.5     84      92        8

                           45      45        0                       91      81       -10

                           77      94       17                       83      90        7

                           27      36        9                       67      73        6
diff     rank   rank                      diff     rank   rank
                          exam1   exam2                             exam1   exam2
                                          (ex2-ex1)    (+)    (-)                   (ex2-ex1)    (+)    (-)

The next smallest          95      97        2        3.5            72      68        -4
non-zero |differences|     76      76        0                       78      94       16
are the two |-3|’s and
the |3|. Since they are    82      75        -7                      58      55        -3               6

tied for ranks 5, 6,       48      54        6                       73      75        2        3.5
and 7, we rank them
                           27      31        4                       71      70        -1              1.5
all 6.
                           34      39        5                       69      66        -3               6
Then we put the ranks
in the appropriately       58      61        3         6             57      62        5

signed columns.            98      97        -1              1.5     84      92        8

                           45      45        0                       91      81       -10

                           77      94       17                       83      90        7

                           27      36        9                       67      73        6
diff     rank   rank                      diff     rank   rank
                     exam1   exam2                             exam1   exam2
                                     (ex2-ex1)    (+)    (-)                   (ex2-ex1)    (+)    (-)

We continue until     95      97        2        3.5            72      68        -4              8.5

we have ranked all    76      76        0                       78      94       16        19
the non-zero |
differences| .        82      75        -7              14.5    58      55        -3               6


                      48      54        6        12.5           73      75        2        3.5


                      27      31        4        8.5            71      70        -1              1.5


                      34      39        5        10.5           69      66        -3               6


                      58      61        3         6             57      62        5        10.5


                      98      97        -1              1.5     84      92        8        16


                      45      45        0                       91      81       -10              18


                      77      94       17        20             83      90        7        14.5


                      27      36        9        17             67      73        6        12.5
diff     rank   rank                      diff     rank   rank
                          exam1   exam2                             exam1   exam2
                                          (ex2-ex1)    (+)    (-)                   (ex2-ex1)    (+)    (-)

Then we total the          95      97        2        3.5            72      68        -4              8.5

signed ranks. We
                           76      76        0                       78      94       16        19
get 154 for the sum
of the positive ranks      82      75        -7              14.5    58      55        -3               6

and 56 for the sum of
                           48      54        6        12.5           73      75        2        3.5
the negative ranks.
The Wilcoxon test          27      31        4        8.5            71      70        -1              1.5

statistic is the sum of    34      39        5        10.5           69      66        -3               6
the positive ranks.
So W = 154.                58      61        3         6             57      62        5        10.5


                           98      97        -1              1.5     84      92        8        16


                           45      45        0                       91      81       -10              18


                           77      94       17        20             83      90        7        14.5


                           27      36        9        17             67      73        6        12.5


                                                                                                154    56
Since we had 22 students and 2 zero differences, the number of
 non-zero differences n = 20.
                                         n(n + 1) (20)(21)
 Recall that the mean of W is µW =                =         = 105
                                            4           4
 The standard deviation of W is
                 n(n + 1)(2n + 1)   20(21)(41)
            σW =                  =            = 26.786
                        24              24

                            W − µW        154 − 105
So we have :           Z=               =           = 1.829
                               σW          26.786
Since the critical values for a
2-tailed Z test at the 5% level
                                    critical                                    critical
are 1.96 and -1.96, we can not      region
                                                       .475       .475          region
reject the null hypothesis H0 and
                                               .025                      .025
so we conclude that the medians
are the same.                                  -1.96          0     1.96               Z
For small sample sizes, you can use Table E.9 in
your textbook, which provides the lower and upper
critical values for the Wilcoxon Signed Rank Test.

That table shows that for our 5% 2-tailed test, the
  lower critical value is 52 and the upper critical
  value is 158.
Since the sum of our positive ranks is 154, which is
  inside the interval (52, 158) indicated in the table,
  we can not reject the null hypothesis and so we
  conclude that the medians are the same.
The Kruskal-Wallis Test
This test is used to test whether several populations have the
same median.
It is a nonparametric substitute for a one-factor ANOVA F-test.
12  R j 
                                       2

The test statistic is K =          ∑     - 3(n + 1) ,
                          n(n + 1) 
                                     nj 
                                         
where nj is the number of observations in the jth sample,
      n is the total number of observations, and
      Rj is the sum of ranks for the jth sample.
If each n j ≥ 5 and the null hypothesis is true,
then the distribution of K is χ 2 with dof = c - 1,
where c is the number of sample groups.

In the case of ties, a corrected statistic should be computed:
              K
  Kc =                       where tj is the number of ties in
           ∑ (t 3 − t j ) 
                 j
       1-                  the jth sample.
           n −n 
               3
                          
Kruskal-Wallis Test Example: Test at the 5% level whether
average employee performance is the same at 3 firms, using
the following standardized test scores for 20 employees.
              Firm 1           Firm 2           Firm 3
        score     rank   score     rank   score     rank
         78               68               82
         95               77               65
         85               84               50
         87               61               93
         75               62               70
         90               72               60
         80                                73
        n1 = 7           n2 = 6           n3 =7
We rank all the scores. Then we sum the ranks for each firm.
Then we calculate the K statistic.

                Firm 1              Firm 2             Firm 3
          score     rank      score     rank     score     rank
           78        12        68            6    82        14
           95        20        77        11       65            5
           85        16        84        15       50            1
           87        17        61            3    93        19
           75        10        62            4    70            7
           90        18        72            8    60            2
           80        13                           73            9
          n1 = 7   R1 = 106   n2 = 6 R2 = 47     n3 =7    R3 = 57

     12  R j 
                2
            ∑     - 3(n + 1) =   12  106 2 47 2 57 2 
K=                                      
                                         7 + 6 + 7  - 3(21) = 6.641
                                                        
            
   n(n + 1)      
               nj               20(21)                
f(χ2)




                                           crit.
                      acceptance           reg.
                        region
                                     .05
                                   5.991           χ 22

From the χ2 table, we see that the 5% critical value for a χ2
with 2 dof is 5.991.
Since our value for K was 6.641, we reject H0 that the
medians are the same and accept H1 that the medians are
different.
One sample test of runs

a test for randomness of order of occurrence
A run is a sequence of identical occurrences
that are followed and preceded by different
occurrences.

Example: The list of X’s & O’s below consists of 7 runs.

xxxooooxxooooxxxxoox
Suppose r is the number of runs, n1 is the number of
type 1 occurrences and n2 is the number of type 2
occurrences.
The mean number of runs is
                     2n1n 2
              μr =           + 1.
                    n1 + n 2
The standard deviation of the number of runs is
                   2n1n 2 (2n1n 2 - n1 - n 2 )
            σr =                               .
                   (n1 + n 2 ) (n1 + n 2 − 1)
                              2
If n1 and n2 are each at least 10, then r is
approximately normal.

                   r - µr
 So,            Z=
                     σr
 is a standard normal variable.
Example: A stock exhibits the following price increase (+)
   and decrease (−) behavior over 25 business days. Test at the
   1% whether the pattern is random.
                                                       r =16,
   + + + − − + − − − + + − + − + − − + + − + + − + − n1 (+) = 13,
          2n1n 2                                          n2 (−) =
                         2(13)(12)
    μr =          +1 =              + 1 = 13.48        12
          n1 + n 2           13 + 12
     2n1n 2 (2n1n 2 - n1 - n 2 )     2(13)(12) [(2(13)(12) - 13 - 12]
σr =                             =                                    = 2.44
     (n1 + n 2 ) (n1 + n 2 − 1)
                2
                                        (13 + 12) (13 + 12 − 1)
                                                  2



       r - µ r 16 - 13.48
    Z=        =           = 1.03                 critical                critical
         σr       2.44                           region     .495 .495
                                                            acceptance
                                                                         region
                                                                          .005
                                                  .005
 Since the critical values for a 2-tailed 1%                  region

 test are 2.575 and -2.575, we accept H0              -2.575    0    2.575     Z
 that the pattern is random.

More Related Content

What's hot

Parametric test - t Test, ANOVA, ANCOVA, MANOVA
Parametric test  - t Test, ANOVA, ANCOVA, MANOVAParametric test  - t Test, ANOVA, ANCOVA, MANOVA
Parametric test - t Test, ANOVA, ANCOVA, MANOVA
Princy Francis M
 
Hypothesis testing chi square goodness of fit test
Hypothesis testing chi square goodness of fit testHypothesis testing chi square goodness of fit test
Hypothesis testing chi square goodness of fit test
Nadeem Uddin
 
The two sample t-test
The two sample t-testThe two sample t-test
The two sample t-test
Christina K J
 
Wilcoxon Rank-Sum Test
Wilcoxon Rank-Sum TestWilcoxon Rank-Sum Test
Wilcoxon Rank-Sum Test
Sahil Jain
 
Mann Whitney U test
Mann Whitney U testMann Whitney U test
Mann Whitney U test
Dr. Ankit Gaur
 
Chi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemarChi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemar
Azmi Mohd Tamil
 
Mann- Whitney Test.pptx
Mann- Whitney Test.pptxMann- Whitney Test.pptx
Mann- Whitney Test.pptx
EchaACagalitan
 
Parametric Test
Parametric TestParametric Test
Parametric Test
AmritaKumari83
 
Introduction to t-tests (statistics)
Introduction to t-tests (statistics)Introduction to t-tests (statistics)
Introduction to t-tests (statistics)
Dr Bryan Mills
 
F test and ANOVA
F test and ANOVAF test and ANOVA
F test and ANOVA
Parag Shah
 
The Kruskal-Wallis H Test
The Kruskal-Wallis H TestThe Kruskal-Wallis H Test
The Kruskal-Wallis H Test
Dr. Ankit Gaur
 
Regression ppt
Regression pptRegression ppt
Regression ppt
Shraddha Tiwari
 
All non parametric test
All non parametric testAll non parametric test
All non parametric test
gopinathannsriramachandraeduin
 
Wilcoxon Signed Rank Test
Wilcoxon Signed Rank Test Wilcoxon Signed Rank Test
Wilcoxon Signed Rank Test
Sharlaine Ruth
 
Analysis Of Variance - ANOVA
Analysis Of Variance - ANOVAAnalysis Of Variance - ANOVA
Analysis Of Variance - ANOVA
Saumya Bhatnagar
 
T test
T testT test
T test
ashishjaswal
 
All non parametric test
All non parametric testAll non parametric test
All non parametric test
gopinathannsriramachandraeduin
 
NON-PARAMETRIC TESTS by Prajakta Sawant
NON-PARAMETRIC TESTS by Prajakta SawantNON-PARAMETRIC TESTS by Prajakta Sawant
NON-PARAMETRIC TESTS by Prajakta Sawant
PRAJAKTASAWANT33
 
Application of ANOVA
Application of ANOVAApplication of ANOVA
Application of ANOVA
Rohit Patidar
 

What's hot (20)

Parametric test - t Test, ANOVA, ANCOVA, MANOVA
Parametric test  - t Test, ANOVA, ANCOVA, MANOVAParametric test  - t Test, ANOVA, ANCOVA, MANOVA
Parametric test - t Test, ANOVA, ANCOVA, MANOVA
 
Hypothesis testing chi square goodness of fit test
Hypothesis testing chi square goodness of fit testHypothesis testing chi square goodness of fit test
Hypothesis testing chi square goodness of fit test
 
The two sample t-test
The two sample t-testThe two sample t-test
The two sample t-test
 
Wilcoxon Rank-Sum Test
Wilcoxon Rank-Sum TestWilcoxon Rank-Sum Test
Wilcoxon Rank-Sum Test
 
Mann Whitney U test
Mann Whitney U testMann Whitney U test
Mann Whitney U test
 
Chi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemarChi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemar
 
Mann- Whitney Test.pptx
Mann- Whitney Test.pptxMann- Whitney Test.pptx
Mann- Whitney Test.pptx
 
Parametric Test
Parametric TestParametric Test
Parametric Test
 
Introduction to t-tests (statistics)
Introduction to t-tests (statistics)Introduction to t-tests (statistics)
Introduction to t-tests (statistics)
 
F test and ANOVA
F test and ANOVAF test and ANOVA
F test and ANOVA
 
Multiple regression
Multiple regressionMultiple regression
Multiple regression
 
The Kruskal-Wallis H Test
The Kruskal-Wallis H TestThe Kruskal-Wallis H Test
The Kruskal-Wallis H Test
 
Regression ppt
Regression pptRegression ppt
Regression ppt
 
All non parametric test
All non parametric testAll non parametric test
All non parametric test
 
Wilcoxon Signed Rank Test
Wilcoxon Signed Rank Test Wilcoxon Signed Rank Test
Wilcoxon Signed Rank Test
 
Analysis Of Variance - ANOVA
Analysis Of Variance - ANOVAAnalysis Of Variance - ANOVA
Analysis Of Variance - ANOVA
 
T test
T testT test
T test
 
All non parametric test
All non parametric testAll non parametric test
All non parametric test
 
NON-PARAMETRIC TESTS by Prajakta Sawant
NON-PARAMETRIC TESTS by Prajakta SawantNON-PARAMETRIC TESTS by Prajakta Sawant
NON-PARAMETRIC TESTS by Prajakta Sawant
 
Application of ANOVA
Application of ANOVAApplication of ANOVA
Application of ANOVA
 

Viewers also liked

AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
DataminingTools Inc
 
AI: Planning and AI
AI: Planning and AIAI: Planning and AI
AI: Planning and AI
DataminingTools Inc
 
2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence
Mhd Sb
 
AI: Learning in AI
AI: Learning in AI AI: Learning in AI
AI: Learning in AI
DataminingTools Inc
 
Planning
PlanningPlanning
Planning
ahmad bassiouny
 
Non parametric tests
Non parametric testsNon parametric tests
Non parametric tests
Raghavendra Huchchannavar
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
u053675
 
Artificial Intelligence Presentation
Artificial Intelligence PresentationArtificial Intelligence Presentation
Artificial Intelligence Presentationlpaviglianiti
 

Viewers also liked (11)

Intelligent agent
Intelligent agentIntelligent agent
Intelligent agent
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
AI: Planning and AI
AI: Planning and AIAI: Planning and AI
AI: Planning and AI
 
2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence
 
AI: Learning in AI
AI: Learning in AI AI: Learning in AI
AI: Learning in AI
 
Planning
PlanningPlanning
Planning
 
Non-Parametric Tests
Non-Parametric TestsNon-Parametric Tests
Non-Parametric Tests
 
Ai Slides
Ai SlidesAi Slides
Ai Slides
 
Non parametric tests
Non parametric testsNon parametric tests
Non parametric tests
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Artificial Intelligence Presentation
Artificial Intelligence PresentationArtificial Intelligence Presentation
Artificial Intelligence Presentation
 

Similar to Nonparametric statistics

Non parametrics tests
Non parametrics testsNon parametrics tests
Non parametrics tests
rodrick koome
 
Linear regression
Linear regressionLinear regression
Linear regression
Karishma Chaudhary
 
Hypothesis testing part iii for difference of means
Hypothesis testing part iii for difference of meansHypothesis testing part iii for difference of means
Hypothesis testing part iii for difference of means
Nadeem Uddin
 
Hypothesis testing
Hypothesis testingHypothesis testing
Hypothesis testing
ShaikhSaifullahKhali
 
C2 st lecture 10 basic statistics and the z test handout
C2 st lecture 10   basic statistics and the z test handoutC2 st lecture 10   basic statistics and the z test handout
C2 st lecture 10 basic statistics and the z test handoutfatima d
 
33851.ppt
33851.ppt33851.ppt
Topic 1 part 2
Topic 1 part 2Topic 1 part 2
Topic 1 part 2
Ryan Herzog
 
C2 st lecture 12 the chi squared-test handout
C2 st lecture 12   the chi squared-test handoutC2 st lecture 12   the chi squared-test handout
C2 st lecture 12 the chi squared-test handoutfatima d
 
Probability Assignment Help
Probability Assignment HelpProbability Assignment Help
Probability Assignment Help
Statistics Assignment Help
 
Correlation
CorrelationCorrelation
Correlation
harshika5
 
Chi square distribution and analysis of frequencies.pptx
Chi square distribution and analysis of frequencies.pptxChi square distribution and analysis of frequencies.pptx
Chi square distribution and analysis of frequencies.pptx
ZayYa9
 
Regression and corelation (Biostatistics)
Regression and corelation (Biostatistics)Regression and corelation (Biostatistics)
Regression and corelation (Biostatistics)
Muhammadasif909
 
Two Means, Independent Samples
Two Means, Independent SamplesTwo Means, Independent Samples
Two Means, Independent Samples
Long Beach City College
 
Stat2013
Stat2013Stat2013
C2 st lecture 13 revision for test b handout
C2 st lecture 13   revision for test b handoutC2 st lecture 13   revision for test b handout
C2 st lecture 13 revision for test b handoutfatima d
 
Chapter12
Chapter12Chapter12
Chapter12
Richard Ferreria
 
Top schools in ghaziabad
Top schools in ghaziabadTop schools in ghaziabad
Top schools in ghaziabad
Edhole.com
 
Top schools in India | Delhi NCR | Noida |
Top schools in India | Delhi NCR | Noida | Top schools in India | Delhi NCR | Noida |
Top schools in India | Delhi NCR | Noida |
Edhole.com
 
Chapter07.pdf
Chapter07.pdfChapter07.pdf
Chapter07.pdf
KarenJoyBabida
 

Similar to Nonparametric statistics (20)

Non parametrics tests
Non parametrics testsNon parametrics tests
Non parametrics tests
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Hypothesis testing part iii for difference of means
Hypothesis testing part iii for difference of meansHypothesis testing part iii for difference of means
Hypothesis testing part iii for difference of means
 
Hypothesis testing
Hypothesis testingHypothesis testing
Hypothesis testing
 
C2 st lecture 10 basic statistics and the z test handout
C2 st lecture 10   basic statistics and the z test handoutC2 st lecture 10   basic statistics and the z test handout
C2 st lecture 10 basic statistics and the z test handout
 
33851.ppt
33851.ppt33851.ppt
33851.ppt
 
Topic 1 part 2
Topic 1 part 2Topic 1 part 2
Topic 1 part 2
 
C2 st lecture 12 the chi squared-test handout
C2 st lecture 12   the chi squared-test handoutC2 st lecture 12   the chi squared-test handout
C2 st lecture 12 the chi squared-test handout
 
Probability Assignment Help
Probability Assignment HelpProbability Assignment Help
Probability Assignment Help
 
Correlation
CorrelationCorrelation
Correlation
 
Chi square distribution and analysis of frequencies.pptx
Chi square distribution and analysis of frequencies.pptxChi square distribution and analysis of frequencies.pptx
Chi square distribution and analysis of frequencies.pptx
 
Regression and corelation (Biostatistics)
Regression and corelation (Biostatistics)Regression and corelation (Biostatistics)
Regression and corelation (Biostatistics)
 
Two Means, Independent Samples
Two Means, Independent SamplesTwo Means, Independent Samples
Two Means, Independent Samples
 
Stat2013
Stat2013Stat2013
Stat2013
 
C2 st lecture 13 revision for test b handout
C2 st lecture 13   revision for test b handoutC2 st lecture 13   revision for test b handout
C2 st lecture 13 revision for test b handout
 
Chapter12
Chapter12Chapter12
Chapter12
 
Top schools in ghaziabad
Top schools in ghaziabadTop schools in ghaziabad
Top schools in ghaziabad
 
Chi sqr
Chi sqrChi sqr
Chi sqr
 
Top schools in India | Delhi NCR | Noida |
Top schools in India | Delhi NCR | Noida | Top schools in India | Delhi NCR | Noida |
Top schools in India | Delhi NCR | Noida |
 
Chapter07.pdf
Chapter07.pdfChapter07.pdf
Chapter07.pdf
 

More from Tarun Gehlot

Materials 11-01228
Materials 11-01228Materials 11-01228
Materials 11-01228
Tarun Gehlot
 
Binary relations
Binary relationsBinary relations
Binary relations
Tarun Gehlot
 
Continuity and end_behavior
Continuity and  end_behaviorContinuity and  end_behavior
Continuity and end_behavior
Tarun Gehlot
 
Continuity of functions by graph (exercises with detailed solutions)
Continuity of functions by graph   (exercises with detailed solutions)Continuity of functions by graph   (exercises with detailed solutions)
Continuity of functions by graph (exercises with detailed solutions)
Tarun Gehlot
 
Factoring by the trial and-error method
Factoring by the trial and-error methodFactoring by the trial and-error method
Factoring by the trial and-error method
Tarun Gehlot
 
Introduction to finite element analysis
Introduction to finite element analysisIntroduction to finite element analysis
Introduction to finite element analysis
Tarun Gehlot
 
Finite elements : basis functions
Finite elements : basis functionsFinite elements : basis functions
Finite elements : basis functions
Tarun Gehlot
 
Finite elements for 2‐d problems
Finite elements  for 2‐d problemsFinite elements  for 2‐d problems
Finite elements for 2‐d problems
Tarun Gehlot
 
Error analysis statistics
Error analysis   statisticsError analysis   statistics
Error analysis statistics
Tarun Gehlot
 
Matlab commands
Matlab commandsMatlab commands
Matlab commands
Tarun Gehlot
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
Tarun Gehlot
 
Linear approximations and_differentials
Linear approximations and_differentialsLinear approximations and_differentials
Linear approximations and_differentials
Tarun Gehlot
 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximation
Tarun Gehlot
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functions
Tarun Gehlot
 
Propeties of-triangles
Propeties of-trianglesPropeties of-triangles
Propeties of-triangles
Tarun Gehlot
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadratures
Tarun Gehlot
 
Basics of set theory
Basics of set theoryBasics of set theory
Basics of set theory
Tarun Gehlot
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
Tarun Gehlot
 
Applications of set theory
Applications of  set theoryApplications of  set theory
Applications of set theory
Tarun Gehlot
 
Miscellneous functions
Miscellneous  functionsMiscellneous  functions
Miscellneous functions
Tarun Gehlot
 

More from Tarun Gehlot (20)

Materials 11-01228
Materials 11-01228Materials 11-01228
Materials 11-01228
 
Binary relations
Binary relationsBinary relations
Binary relations
 
Continuity and end_behavior
Continuity and  end_behaviorContinuity and  end_behavior
Continuity and end_behavior
 
Continuity of functions by graph (exercises with detailed solutions)
Continuity of functions by graph   (exercises with detailed solutions)Continuity of functions by graph   (exercises with detailed solutions)
Continuity of functions by graph (exercises with detailed solutions)
 
Factoring by the trial and-error method
Factoring by the trial and-error methodFactoring by the trial and-error method
Factoring by the trial and-error method
 
Introduction to finite element analysis
Introduction to finite element analysisIntroduction to finite element analysis
Introduction to finite element analysis
 
Finite elements : basis functions
Finite elements : basis functionsFinite elements : basis functions
Finite elements : basis functions
 
Finite elements for 2‐d problems
Finite elements  for 2‐d problemsFinite elements  for 2‐d problems
Finite elements for 2‐d problems
 
Error analysis statistics
Error analysis   statisticsError analysis   statistics
Error analysis statistics
 
Matlab commands
Matlab commandsMatlab commands
Matlab commands
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Linear approximations and_differentials
Linear approximations and_differentialsLinear approximations and_differentials
Linear approximations and_differentials
 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximation
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functions
 
Propeties of-triangles
Propeties of-trianglesPropeties of-triangles
Propeties of-triangles
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadratures
 
Basics of set theory
Basics of set theoryBasics of set theory
Basics of set theory
 
Numerical integration
Numerical integrationNumerical integration
Numerical integration
 
Applications of set theory
Applications of  set theoryApplications of  set theory
Applications of set theory
 
Miscellneous functions
Miscellneous  functionsMiscellneous  functions
Miscellneous functions
 

Recently uploaded

Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 

Recently uploaded (20)

Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 

Nonparametric statistics

  • 2. In previous testing, we assumed that our samples were drawn from normally distributed populations. This chapter introduces some techniques that do not make that assumption. These methods are called distribution-free or nonparametric tests. In situations where the normal assumption is appropriate, nonparametric tests are less efficient than traditional parametric methods. Nonparametric tests frequently make use only of the order of the observations and not the actual values.
  • 3. In this section, we will discuss four nonparametric tests: the Wilcoxon Rank Sum Test (or Mann-Whitney U test), the Wilcoxon Signed Ranks Test, the Kruskal-Wallis Test, and the one sample test of runs.
  • 4. The Wilcoxon Rank Sum Test or Mann-Whitney U Test This test is used to test whether 2 independent samples have been drawn from populations with the same median. It is a nonparametric substitute for the t-test on the difference between two means.
  • 5. Wilcoxon Rank Sum Test Example: university Based on the following samples from A B two universities, test at the 10% level 50 70 whether graduates from the two 52 73 schools have the same average grade 56 77 on an aptitude test. 60 80 64 83 68 85 71 87 74 88 89 96 95 99
  • 6. First merge and rank the grades. rank grade university Sum the ranks for each sample. 1 50 A rank sum for university A: 74 2 52 A rank sum for university B: 136 3 56 A 4 60 A university 5 64 A 6 68 A Note: If there are A B 7 70 B ties, each value 50 70 8 71 A gets the average 52 73 9 73 B rank. For example, 10 74 A if 2 values tie for 56 77 11 77 B 3th and 4th place, 60 80 both are ranked 12 80 B 64 83 13 83 B 3.5. If three differences would 68 85 14 85 B 15 87 B be ranked 7, 8, and 71 87 9, rank them all 8. 16 88 B 74 88 17 89 A 89 96 18 95 A 19 96 B 95 99 20 99 B
  • 7. Here, the group from university A is considered the 1st sample. When the samples differ in size, designate the smaller of the 2 samples as the 1st sample. Define T1 = sum of the ranks for 1st sample . n1 (n1 + n2 + 1) The mean of T1 is µT1 = , 2 n1n 2 (n1 + n2 + 1) and the standard deviation is σ T1 = . 12 If n1 and n 2 are each at least 10, T1 is approximately normal. T1 - µT1 So, Z = has a standard normal distribution. σ T1 (For small sample sizes, the Z approximation is sometimes used as well.)
  • 8. For our example, T1 = 74. n1 (n + 1) 10(20 + 1) µT1 = = = 105 2 2 n1n 2 (n + 1) (10)(10)(20 + 1) σ T1 = = = 13.229 12 12 T1 - µT1 74 - 105 Z = = = -2.343. σ T1 13.229 Since the critical values for a 2-tailed Z test at the 10% level are 1.645 and -1.645, we critical critical region region reject H0 that the medians are .45 .45 the same and accept H1 that .05 .05 the medians are different. -1.645 0 1.645 Z
  • 9. For small sample sizes, you can use Table E.8 in your textbook, which provides the lower and upper critical values for the Wilcoxon Rank Sum Test. That table shows that for our 10% 2-tailed test, the lower critical value is 82 and the upper critical value is 128. Since our smaller sample’s rank sum is 74, which is outside the interval (82, 128) indicated in the table, we reject the null hypothesis that the medians are the same and conclude that they are different. Equivalently, since the larger sample’s rank sum is 136, which is also outside the interval (82, 128), we again reject the null hypothesis that the medians are the same and conclude that they are different.
  • 10. The Wilcoxon Signed Rank Test This test is used to test whether 2 dependent samples have been drawn from populations with the same median. It is a nonparametric substitute for the paired t-test on the difference between two means.
  • 11. Wilcoxon Signed Rank Test Procedure 1. Calculate the differences in the paired values (Di=X1i – X2i) 2. Take absolute values of the differences and rank them (Discard all differences that equal 0.) 3. Assign ranks Ri with the smallest rank equal to 1. As in the rank sum test, if two or more of the differences are equal, each difference gets the average rank. (That is, if two differences would be ranked 3 and 4, rank them both 3.5. If three differences would be ranked 7, 8, and 9, rank them all 8.) 4. Assign the symbol + to positive differences and – to negative differences. 5. Calculate the Wilcoxon statistic W as the sum of the positive ranks. So, W= ∑ Ri+
  • 12. Wilcoxon Signed Rank Test Procedure (cont’d) In the following, n refers to the number of non - zero differences. n(n + 1) The mean of the Wilcoxon statistic W is µW = 4 The standard deviation of the Wilcoxon statistic W is n(n + 1)(2n + 1) σW = 24 If n is at least 20, the test statistic W is approximately normal. So we have : W − µW Z= σW (For small sample sizes, the Z approximation is sometimes used as well.)
  • 13. diff rank rank diff rank rank exam1 exam2 exam1 exam2 (ex2-ex1) (+) (-) (ex2-ex1) (+) (-) Example 95 97 72 68 Suppose we have 76 76 78 94 a class with 22 82 75 58 55 students, each of whom has two 48 54 73 75 exam grades. 27 31 71 70 We want to test at 34 39 69 66 the 5% level 58 61 57 62 whether there is a difference in the 98 97 84 92 median grade for 45 45 91 81 the two exams. 77 94 83 90 27 36 67 73
  • 14. diff rank rank diff rank rank exam1 exam2 exam1 exam2 (ex2-ex1) (+) (-) (ex2-ex1) (+) (-) We calculate the 95 97 2 72 68 -4 difference between the exam grades: 76 76 0 78 94 16 diff = exam2 – exam 1. 82 75 -7 58 55 -3 48 54 6 73 75 2 27 31 4 71 70 -1 34 39 5 69 66 -3 58 61 3 57 62 5 98 97 -1 84 92 8 45 45 0 91 81 -10 77 94 17 83 90 7 27 36 9 67 73 6
  • 15. diff rank rank diff rank rank exam1 exam2 exam1 exam2 Then we rank the (ex2-ex1) (+) (-) (ex2-ex1) (+) (-) absolute values of the 95 97 2 72 68 -4 differences from smallest to largest, 76 76 0 78 94 16 omitting the two zero 82 75 -7 58 55 -3 differences. 48 54 6 73 75 2 The smallest non-zero |differences| are the 27 31 4 71 70 -1 1.5 two |-1|’s. Since they 34 39 5 69 66 -3 are tied for ranks 1 and 2, we rank them 58 61 3 57 62 5 both 1.5. 98 97 -1 1.5 84 92 8 Since the differences 45 45 0 91 81 -10 were negative, we put the ranks in the 77 94 17 83 90 7 negative column. 27 36 9 67 73 6
  • 16. diff rank rank diff rank rank exam1 exam2 exam1 exam2 (ex2-ex1) (+) (-) (ex2-ex1) (+) (-) The next smallest 95 97 2 3.5 72 68 -4 non-zero |differences| 76 76 0 78 94 16 are the two |2|’s. Since they are tied for 82 75 -7 58 55 -3 ranks 3 and 4, we 48 54 6 73 75 2 3.5 rank them both 3.5. Since the differences 27 31 4 71 70 -1 1.5 were positive, we put 34 39 5 69 66 -3 the ranks in the positive column. 58 61 3 57 62 5 98 97 -1 1.5 84 92 8 45 45 0 91 81 -10 77 94 17 83 90 7 27 36 9 67 73 6
  • 17. diff rank rank diff rank rank exam1 exam2 exam1 exam2 (ex2-ex1) (+) (-) (ex2-ex1) (+) (-) The next smallest 95 97 2 3.5 72 68 -4 non-zero |differences| 76 76 0 78 94 16 are the two |-3|’s and the |3|. Since they are 82 75 -7 58 55 -3 6 tied for ranks 5, 6, 48 54 6 73 75 2 3.5 and 7, we rank them 27 31 4 71 70 -1 1.5 all 6. 34 39 5 69 66 -3 6 Then we put the ranks in the appropriately 58 61 3 6 57 62 5 signed columns. 98 97 -1 1.5 84 92 8 45 45 0 91 81 -10 77 94 17 83 90 7 27 36 9 67 73 6
  • 18. diff rank rank diff rank rank exam1 exam2 exam1 exam2 (ex2-ex1) (+) (-) (ex2-ex1) (+) (-) We continue until 95 97 2 3.5 72 68 -4 8.5 we have ranked all 76 76 0 78 94 16 19 the non-zero | differences| . 82 75 -7 14.5 58 55 -3 6 48 54 6 12.5 73 75 2 3.5 27 31 4 8.5 71 70 -1 1.5 34 39 5 10.5 69 66 -3 6 58 61 3 6 57 62 5 10.5 98 97 -1 1.5 84 92 8 16 45 45 0 91 81 -10 18 77 94 17 20 83 90 7 14.5 27 36 9 17 67 73 6 12.5
  • 19. diff rank rank diff rank rank exam1 exam2 exam1 exam2 (ex2-ex1) (+) (-) (ex2-ex1) (+) (-) Then we total the 95 97 2 3.5 72 68 -4 8.5 signed ranks. We 76 76 0 78 94 16 19 get 154 for the sum of the positive ranks 82 75 -7 14.5 58 55 -3 6 and 56 for the sum of 48 54 6 12.5 73 75 2 3.5 the negative ranks. The Wilcoxon test 27 31 4 8.5 71 70 -1 1.5 statistic is the sum of 34 39 5 10.5 69 66 -3 6 the positive ranks. So W = 154. 58 61 3 6 57 62 5 10.5 98 97 -1 1.5 84 92 8 16 45 45 0 91 81 -10 18 77 94 17 20 83 90 7 14.5 27 36 9 17 67 73 6 12.5 154 56
  • 20. Since we had 22 students and 2 zero differences, the number of non-zero differences n = 20. n(n + 1) (20)(21) Recall that the mean of W is µW = = = 105 4 4 The standard deviation of W is n(n + 1)(2n + 1) 20(21)(41) σW = = = 26.786 24 24 W − µW 154 − 105 So we have : Z= = = 1.829 σW 26.786 Since the critical values for a 2-tailed Z test at the 5% level critical critical are 1.96 and -1.96, we can not region .475 .475 region reject the null hypothesis H0 and .025 .025 so we conclude that the medians are the same. -1.96 0 1.96 Z
  • 21. For small sample sizes, you can use Table E.9 in your textbook, which provides the lower and upper critical values for the Wilcoxon Signed Rank Test. That table shows that for our 5% 2-tailed test, the lower critical value is 52 and the upper critical value is 158. Since the sum of our positive ranks is 154, which is inside the interval (52, 158) indicated in the table, we can not reject the null hypothesis and so we conclude that the medians are the same.
  • 22. The Kruskal-Wallis Test This test is used to test whether several populations have the same median. It is a nonparametric substitute for a one-factor ANOVA F-test.
  • 23. 12  R j  2 The test statistic is K = ∑  - 3(n + 1) , n(n + 1)   nj   where nj is the number of observations in the jth sample, n is the total number of observations, and Rj is the sum of ranks for the jth sample. If each n j ≥ 5 and the null hypothesis is true, then the distribution of K is χ 2 with dof = c - 1, where c is the number of sample groups. In the case of ties, a corrected statistic should be computed: K Kc = where tj is the number of ties in  ∑ (t 3 − t j )  j 1-   the jth sample.  n −n  3  
  • 24. Kruskal-Wallis Test Example: Test at the 5% level whether average employee performance is the same at 3 firms, using the following standardized test scores for 20 employees. Firm 1 Firm 2 Firm 3 score rank score rank score rank 78 68 82 95 77 65 85 84 50 87 61 93 75 62 70 90 72 60 80 73 n1 = 7 n2 = 6 n3 =7
  • 25. We rank all the scores. Then we sum the ranks for each firm. Then we calculate the K statistic. Firm 1 Firm 2 Firm 3 score rank score rank score rank 78 12 68 6 82 14 95 20 77 11 65 5 85 16 84 15 50 1 87 17 61 3 93 19 75 10 62 4 70 7 90 18 72 8 60 2 80 13 73 9 n1 = 7 R1 = 106 n2 = 6 R2 = 47 n3 =7 R3 = 57 12  R j  2 ∑  - 3(n + 1) = 12  106 2 47 2 57 2  K=   7 + 6 + 7  - 3(21) = 6.641   n(n + 1)   nj  20(21)  
  • 26. f(χ2) crit. acceptance reg. region .05 5.991 χ 22 From the χ2 table, we see that the 5% critical value for a χ2 with 2 dof is 5.991. Since our value for K was 6.641, we reject H0 that the medians are the same and accept H1 that the medians are different.
  • 27. One sample test of runs a test for randomness of order of occurrence
  • 28. A run is a sequence of identical occurrences that are followed and preceded by different occurrences. Example: The list of X’s & O’s below consists of 7 runs. xxxooooxxooooxxxxoox
  • 29. Suppose r is the number of runs, n1 is the number of type 1 occurrences and n2 is the number of type 2 occurrences. The mean number of runs is 2n1n 2 μr = + 1. n1 + n 2 The standard deviation of the number of runs is 2n1n 2 (2n1n 2 - n1 - n 2 ) σr = . (n1 + n 2 ) (n1 + n 2 − 1) 2
  • 30. If n1 and n2 are each at least 10, then r is approximately normal. r - µr So, Z= σr is a standard normal variable.
  • 31. Example: A stock exhibits the following price increase (+) and decrease (−) behavior over 25 business days. Test at the 1% whether the pattern is random. r =16, + + + − − + − − − + + − + − + − − + + − + + − + − n1 (+) = 13, 2n1n 2 n2 (−) = 2(13)(12) μr = +1 = + 1 = 13.48 12 n1 + n 2 13 + 12 2n1n 2 (2n1n 2 - n1 - n 2 ) 2(13)(12) [(2(13)(12) - 13 - 12] σr = = = 2.44 (n1 + n 2 ) (n1 + n 2 − 1) 2 (13 + 12) (13 + 12 − 1) 2 r - µ r 16 - 13.48 Z= = = 1.03 critical critical σr 2.44 region .495 .495 acceptance region .005 .005 Since the critical values for a 2-tailed 1% region test are 2.575 and -2.575, we accept H0 -2.575 0 2.575 Z that the pattern is random.