KolmogorovSmirnov Test - PowerPoint PPT Presentation

About This Presentation
Title:

KolmogorovSmirnov Test

Description:

Suppose we don't know how the differences in treatments might show up - shift? ... help(plot.stepfun) plot(ecdf(trt1),col.h='red') plot(ecdf(trt2),add=T,col.h='blue' ... – PowerPoint PPT presentation

Number of Views:203
Avg rating:3.0/5.0
Slides: 3
Provided by: darganfr
Category:

less

Transcript and Presenter's Notes

Title: KolmogorovSmirnov Test


1
Kolmogorov-Smirnov Test
  • Assume Xi from treatment 1 and Yj from treatment
    2 and that they have empirical cdf's
  • given by
  • Suppose we don't know how the differences in
    treatments might show up - shift? change in
    variance? ? . We would like an omnibus test as
    the textbook calls it, that is "designed to pick
    up differences among treatments regardless of the
    nature of the differences". We'll use the
    Kolmogorov-Smirnov test which essentially finds
    the maximum absolute difference between the two
    empirical cdf's
  • Large values of D indicate the samples are
    coming from different populations - there are
    tables of D or we could do permutation tests, or
    large sample approximations as in SAS
  • PROC NPAR1WAY KS CLASS class_variable
  • VAR response_variable
  • the EXACT KS statement may also be used see
    SAS help...
  • See Table 2.8.2 on page 57 for a simple example

2
  • The complete permutation distribution for the D
    statistic, assuming there is no difference in the
    population cdfs, is given in Table 2.8.3note
    that the p-value is found by computing the
    probability of getting our value of D (.4) or
    greater (13070182)/252 220/252 .873
  • There is also a function in R called ks.testsee
    the help.start() menu and then try
    ks.test(before,after) to confirm the value of D
    and the p-value given in Example 2.8.4.
  • below is some code for plotting the two ecdfs
    and graphically checking for the maximum
    difference...
  • help(ecdf)
  • help(plot.stepfun)
  • plot(ecdf(trt1),col.h"red")
  • plot(ecdf(trt2),addT,col.h"blue")
Write a Comment
User Comments (0)
About PowerShow.com