SlideShare uma empresa Scribd logo
1 de 31
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.

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Analysis of variance ppt @ bec doms
Analysis of variance ppt @ bec domsAnalysis of variance ppt @ bec doms
Analysis of variance ppt @ bec doms
 
F test and ANOVA
F test and ANOVAF test and ANOVA
F test and ANOVA
 
Student T - test
Student T -  testStudent T -  test
Student T - test
 
Review & Hypothesis Testing
Review & Hypothesis TestingReview & Hypothesis Testing
Review & Hypothesis Testing
 
The mann whitney u test
The mann whitney u testThe mann whitney u test
The mann whitney u test
 
t distribution, paired and unpaired t-test
t distribution, paired and unpaired t-testt distribution, paired and unpaired t-test
t distribution, paired and unpaired t-test
 
Wilcoxon Rank-Sum Test
Wilcoxon Rank-Sum TestWilcoxon Rank-Sum Test
Wilcoxon Rank-Sum Test
 
Chi square test
Chi square testChi square test
Chi square test
 
One Way ANOVA and Two Way ANOVA using R
One Way ANOVA and Two Way ANOVA using ROne Way ANOVA and Two Way ANOVA using R
One Way ANOVA and Two Way ANOVA using R
 
Wilcoxon signed rank test
Wilcoxon signed rank testWilcoxon signed rank test
Wilcoxon signed rank test
 
SIGN TEST SLIDE.ppt
SIGN TEST SLIDE.pptSIGN TEST SLIDE.ppt
SIGN TEST SLIDE.ppt
 
Non-Parametric Tests
Non-Parametric TestsNon-Parametric Tests
Non-Parametric Tests
 
non parametric statistics
non parametric statisticsnon parametric statistics
non parametric statistics
 
Chi square test final
Chi square test finalChi square test final
Chi square test final
 
The median test
The median testThe median test
The median test
 
The t test
The t testThe t test
The t test
 
Two-Way ANOVA
Two-Way ANOVATwo-Way ANOVA
Two-Way ANOVA
 
Two Way ANOVA
Two Way ANOVATwo Way ANOVA
Two Way ANOVA
 
Introduction to t-tests (statistics)
Introduction to t-tests (statistics)Introduction to t-tests (statistics)
Introduction to t-tests (statistics)
 
Goodness of fit (ppt)
Goodness of fit (ppt)Goodness of fit (ppt)
Goodness of fit (ppt)
 

Destaque (10)

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
 
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
 

Semelhante a Nonparametric statistics

Non parametrics tests
Non parametrics testsNon parametrics tests
Non parametrics testsrodrick koome
 
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 meansNadeem Uddin
 
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
 
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
 
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.pptxZayYa9
 
Regression and corelation (Biostatistics)
Regression and corelation (Biostatistics)Regression and corelation (Biostatistics)
Regression and corelation (Biostatistics)Muhammadasif909
 
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
 
Top schools in ghaziabad
Top schools in ghaziabadTop schools in ghaziabad
Top schools in ghaziabadEdhole.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
 

Semelhante a 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
 

Mais de Tarun Gehlot

Materials 11-01228
Materials 11-01228Materials 11-01228
Materials 11-01228Tarun Gehlot
 
Continuity and end_behavior
Continuity and  end_behaviorContinuity and  end_behavior
Continuity and end_behaviorTarun 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 methodTarun Gehlot
 
Introduction to finite element analysis
Introduction to finite element analysisIntroduction to finite element analysis
Introduction to finite element analysisTarun Gehlot
 
Finite elements : basis functions
Finite elements : basis functionsFinite elements : basis functions
Finite elements : basis functionsTarun Gehlot
 
Finite elements for 2‐d problems
Finite elements  for 2‐d problemsFinite elements  for 2‐d problems
Finite elements for 2‐d problemsTarun Gehlot
 
Error analysis statistics
Error analysis   statisticsError analysis   statistics
Error analysis statisticsTarun Gehlot
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlabTarun Gehlot
 
Linear approximations and_differentials
Linear approximations and_differentialsLinear approximations and_differentials
Linear approximations and_differentialsTarun Gehlot
 
Local linear approximation
Local linear approximationLocal linear approximation
Local linear approximationTarun Gehlot
 
Interpolation functions
Interpolation functionsInterpolation functions
Interpolation functionsTarun Gehlot
 
Propeties of-triangles
Propeties of-trianglesPropeties of-triangles
Propeties of-trianglesTarun Gehlot
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadraturesTarun Gehlot
 
Basics of set theory
Basics of set theoryBasics of set theory
Basics of set theoryTarun Gehlot
 
Numerical integration
Numerical integrationNumerical integration
Numerical integrationTarun Gehlot
 
Applications of set theory
Applications of  set theoryApplications of  set theory
Applications of set theoryTarun Gehlot
 
Miscellneous functions
Miscellneous  functionsMiscellneous  functions
Miscellneous functionsTarun Gehlot
 

Mais de 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
 

Último

Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 

Último (20)

Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 

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.