<TeXmacs|1.0.3>

<style|generic>

<\body>
  <section|Lecture 4 - statistical tests>

  In R it is almost too easy to employ a statistical test!

  One has to be careful to understand what the test tests.

  \;

  <subsection|What is a test?>

  We have a hypothesis, and want to test if the data is consistent with this
  hypothesis. We also have an alternative hypothesis.

  Usually we will\ 

  <\enumerate-numeric>
    <item>Decide on a number to calculate from our data.

    <item>Calculate how likely is one to get this number ``or worse'' given
    our hypothesis.

    (Is ``or worse'' one- or two-sided?)

    <item>This gives us a p-value, which we compare to pre-defined cutoffs.
  </enumerate-numeric>

  The problem: how do we know how likely things are?

  We can either use distributions that the best mathematicians in the world
  figured out, or we can make our own using bootstrapping.

  <subsection|Loading Libraries (packages)>

  In R many functions are stored in libraries. To use them, we need to load
  the library:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      library(ctest)
    </input>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  <subsection|Frequencies>

  If we observe a family with 1 male offspring, and 9 female offspring, is
  the sex ratio 50:50?

  Our hypothesis is that the sex ratio is 50%.

  Since we would have been as surprised to see 1:9 as 9:1, we want to know
  how likely is it to get a ratio of 1:9 or 9:1 or worse?

  How likely are we to get 0:10, 1:9, 9:1, or 10:0 if the ratio is really
  50%?

  The possibilities are:

  <tabular|<tformat|<table|<row|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|>>|<row|<cell|M>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|>>|<row|<cell|F>|<cell|M>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|>>|<row|<cell|F>|<cell|F>|<cell|M>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|>>|<row|<cell|F>|<cell|F>|<cell|F>|<cell|M>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|>>|<row|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|M>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|>>|<row|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|M>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|>>|<row|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|M>|<cell|F>|<cell|F>|<cell|F>|<cell|>>|<row|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|M>|<cell|F>|<cell|F>|<cell|>>|<row|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|M>|<cell|F>|<cell|>>|<row|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|F>|<cell|M>|<cell|>>>>>
  <tabular|<tformat|<table|<row|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|>>|<row|<cell|F>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|>>|<row|<cell|M>|<cell|F>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|>>|<row|<cell|M>|<cell|M>|<cell|F>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|>>|<row|<cell|M>|<cell|M>|<cell|M>|<cell|F>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|>>|<row|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|F>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|>>|<row|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|F>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|>>|<row|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|F>|<cell|M>|<cell|M>|<cell|M>|<cell|>>|<row|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|F>|<cell|M>|<cell|M>|<cell|>>|<row|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|F>|<cell|M>|<cell|>>|<row|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|M>|<cell|F>|<cell|>>>>>

  Each is equally likely. There are 1024 possibilities, 22 of which are as
  bad as our observation, so:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      22/1024
    </input>

    <\output>
      [1] 0.02148438
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  is our p-value.

  R can do this calculation thus:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      binom.test(1,10)
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Exact binomial test

      \;

      data: \ 1 and 10\ 

      number of successes = 1, number of trials = 10, p-value = 0.02148

      alternative hypothesis: true probability of success is not equal to 0.5\ 

      95 percent confidence interval:

      \ 0.002528579 0.445016117\ 

      sample estimates:

      probability of success\ 

      \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0.1\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>

    \;
  </session>>

  And, we get exactly the same p-value!

  In this case, we were ``surprised'' to see so few males. But we had no
  preference for males or females. Therefore our alternative hypothesis was
  that the sex ratio is not 0.5.

  But, maybe in a previous experiment, we already saw few males. Now we just
  want to confirm that it isn't an equal sex ratio, but that we have few
  males.

  In this case we ask: what is the chance to see 1:9 or worse, i.e. 1 male, 9
  females, or 0 males 10 females?

  This is a one-sided test.

  From above we can see that the p-value in this case is 11/1024.

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      binom.test(1,10,alternative="less")
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Exact binomial test

      \;

      data: \ 1 and 10\ 

      number of successes = 1, number of trials = 10, p-value = 0.01074

      alternative hypothesis: true probability of success is less than 0.5\ 

      95 percent confidence interval:

      \ 0.0000000 0.3941633\ 

      sample estimates:

      probability of success\ 

      \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0.1\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  If ahead of time we want to show that there are too few males, but we get 9
  males and 1 female, then we still have to test for less!

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      binom.test(9,10,alternative="less")
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Exact binomial test

      \;

      data: \ 9 and 10\ 

      number of successes = 9, number of trials = 10, p-value = 0.999

      alternative hypothesis: true probability of success is less than 0.5\ 

      95 percent confidence interval:

      \ 0.0000000 0.9948838\ 

      sample estimates:

      probability of success\ 

      \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0.9\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  <subsection|Frequency tables>

  Let us assume that our hypothesis is that the frequency of green, blue, and
  brown eyes in the population is 20%, 30%, 50%.

  We see the following data:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      observed=c(blue=17,blue=25,brown=60)
    </input>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      observed
    </input>

    <\output>
      \ blue \ blue brown\ 

      \ \ \ 17 \ \ \ 25 \ \ \ 60\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      sum(observed)
    </input>

    <\output>
      [1] 102
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  We would expect:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      expected=c(0.2,0.3,0.5)*102
    </input>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      expected
    </input>

    <\output>
      [1] 20.4 30.6 51.0
    </output>
  </session>>

  We could now, for example, sum the absolute difference of
  observed-expected. Or (observed-expected)^2.

  But for all those it will be hard to calculate to get that value.

  For the following function, we do have an approximate distribution:

  (observed value - expected value)^2 / (expected value)

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      chisq.test(c(17,25,60),p=c(0.2,0.3,0.5))
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Chi-squared test for given probabilities

      \;

      data: \ c(17, 25, 60)\ 

      X-squared = 3.1797, df = 2, p-value = 0.2040
    </output>

    \;
  </session>>

  Another example:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      hair=sample(c("blond","black"),90,rep=T,p=c(0.3,0.7))
    </input>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      eyes=sample(c("green","brown"),90,rep=T,p=c(0.8,0.2))
    </input>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      T=table(hair,eyes)
    </input>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      T
    </input>

    <\output>
      \ \ \ \ \ \ \ eyes

      hair \ \ \ brown green

      \ \ black \ 9 \ \ \ 58 \ \ 

      \ \ blond \ 4 \ \ \ 19 \ \ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  We would like to know if hair color and eye color are independent. Our
  hypothesis is that they are independent, and therefore one can calculate
  the chance for each category from\ 

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      chisq.test(T)
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Pearson's Chi-squared test with Yates' continuity
      correction

      \;

      data: \ T\ 

      X-squared = 0.0149, df = 1, p-value = 0.9027

      \;

      Warning message:\ 

      Chi-squared approximation may be incorrect in: chisq.test(T)\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>

    \;
  </session>>

  The reason for the warning is that the chisq.test is only approximate. For
  small values in the table, the test is not exact. Another test is exact in
  this case:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      fisher.test(T)
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Fisher's Exact Test for Count Data

      \;

      data: \ T\ 

      p-value = 0.7327

      alternative hypothesis: true odds ratio is not equal to 1\ 

      95 percent confidence interval:

      \ 0.1796318 3.6673071\ 

      sample estimates:

      odds ratio\ 

      \ 0.7397047\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  <subsection|Comparing means>

  Often we have data from two sources, and would like to know if we have the
  same means, i.e. one is not bigger than the other.

  As before, we can think of many functions one could compute.\ 

  Assuming that the data is normaly distributed, a test called t-test exists:

  The t-test calculates the (difference of the means in the two
  samples)/(std. error of mean)

  To use the t-test we have to know if the variances are the same. To do
  this, there is a test called var.test:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      x=rnorm(20,mean=10)
    </input>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      y=rnorm(20,mean=10.5)
    </input>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      var.test(x,y)
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ F test to compare two variances

      \;

      data: \ x and y\ 

      F = 0.9084, num df = 19, denom df = 19, p-value = 0.8364

      alternative hypothesis: true ratio of variances is not equal to 1\ 

      95 percent confidence interval:

      \ 0.3595679 2.2951056\ 

      sample estimates:

      ratio of variances\ 

      \ \ \ \ \ \ \ \ \ 0.9084307\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  Now we can use the t-test:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      t.test(x,y)
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Welch Two Sample t-test

      \;

      data: \ x and y\ 

      t = -1.1162, df = 37.913, p-value = 0.2714

      alternative hypothesis: true difference in means is not equal to 0\ 

      95 percent confidence interval:

      \ -1.1086930 \ 0.3206622\ 

      sample estimates:

      mean of x mean of y\ 

      \ 10.03693 \ 10.43094\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  Notice that the test did not detect the difference in the variables.

  If we know or suspect that the variances are not the same, we can use a
  parameter of t.test:

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      t.test(x,y,var.eq=F)
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Welch Two Sample t-test

      \;

      data: \ x and y\ 

      t = -1.1162, df = 37.913, p-value = 0.2714

      alternative hypothesis: true difference in means is not equal to 0\ 

      95 percent confidence interval:

      \ -1.1086930 \ 0.3206622\ 

      sample estimates:

      mean of x mean of y\ 

      \ 10.03693 \ 10.43094\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  <subsection|A non-parametric test of means>

  Non-parametric tests don't assume anything about the distribution of the
  variable - they use only the rank of the data.

  The wilcoxon test calculates the rank of all samples, and then sums the
  ranks of the smaller sample, and does various things with them

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      wilcox.test(x,y)
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Wilcoxon rank sum test

      \;

      data: \ x and y\ 

      W = 164, p-value = 0.3408

      alternative hypothesis: true mu is not equal to 0\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  The wilcox test is slightly weaker than the t-test, because it doesn't take
  into account that the data is normal.

  \;

  <subsection|The Kolmogorov-Smirnov test>

  This is a very nice test that compares two distributions. It will differ
  even if the mean is the same but the variance is different.

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      plot(sort(x),1:length(x),type="l")
    </input>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      lines(sort(y),1:length(y),col=2);v()
    </input>

    <\output>
      <postscript|<tuple|<raw-data|%!PS-Adobe-3.0
      EPSF-3.0\n%%DocumentNeededResources: font Helvetica\n%%+ font
      Helvetica-Bold\n%%+ font Helvetica-Oblique\n%%+ font
      Helvetica-BoldOblique\n%%+ font Symbol\n%%Title: R Graphics
      Output\n%%Creator: R Software\n%%Pages: (atend)\n%%BoundingBox: 162 252
      450 540\n%%EndComments\n%%BeginProlog\n/bp \ { gs gs } def\n% begin
      .ps.prolog\n/gs \ { gsave } def\n/gr \ { grestore } def\n/ep \ {
      showpage gr gr } def\n/m \ \ { moveto } def\n/l \ { rlineto } def\n/np
      \ { newpath } def\n/cp \ { closepath } def\n/f \ \ { fill } def\n/o
      \ \ { stroke } def\n/c \ \ { newpath 0 360 arc } def\n/r \ \ { 4 2 roll
      moveto 1 copy 3 -1 roll exch 0 exch rlineto 0 rlineto -1 mul 0 exch
      rlineto closepath } def\n/p1 \ { stroke } def\n/p2 \ { gsave bg
      setrgbcolor fill grestore newpath } def\n/p3 \ { gsave bg setrgbcolor
      fill grestore stroke } def\n/t \ \ { 6 -2 roll moveto gsave rotate\n
      \ \ \ \ \ \ ps mul neg 0 2 1 roll rmoveto\n \ \ \ \ \ \ 1 index
      stringwidth pop\n \ \ \ \ \ \ mul neg 0 rmoveto show grestore }
      def\n/cl \ { grestore gsave newpath 3 index 3 index moveto 1 index\n
      \ \ \ \ \ \ 4 -1 roll lineto \ exch 1 index lineto lineto\n
      \ \ \ \ \ \ closepath clip newpath } def\n/rgb { setrgbcolor } def\n/s
      \ \ { scalefont setfont } def\n/R \ \ { /Font1 findfont } def\n/B \ \ {
      /Font2 findfont } def\n/I \ \ { /Font3 findfont } def\n/BI \ { /Font4
      findfont } def\n/S \ \ { /Font5 findfont } def\n1 setlinecap 1
      setlinejoin\n% end \ \ .ps.prolog\n%%IncludeResource: font
      Helvetica\n/Helvetica findfont\ndup length dict begin\n \ {1 index /FID
      ne {def} {pop pop} ifelse} forall\n \ /Encoding ISOLatin1Encoding def\n
      \ currentdict\n \ end\n/Font1 exch definefont pop\n%%IncludeResource:
      font Helvetica-Bold\n/Helvetica-Bold findfont\ndup length dict begin\n
      \ {1 index /FID ne {def} {pop pop} ifelse} forall\n \ /Encoding
      ISOLatin1Encoding def\n \ currentdict\n \ end\n/Font2 exch definefont
      pop\n%%IncludeResource: font Helvetica-Oblique\n/Helvetica-Oblique
      findfont\ndup length dict begin\n \ {1 index /FID ne {def} {pop pop}
      ifelse} forall\n \ /Encoding ISOLatin1Encoding def\n \ currentdict\n
      \ end\n/Font3 exch definefont pop\n%%IncludeResource: font
      Helvetica-BoldOblique\n/Helvetica-BoldOblique findfont\ndup length dict
      begin\n \ {1 index /FID ne {def} {pop pop} ifelse} forall\n \ /Encoding
      ISOLatin1Encoding def\n \ currentdict\n \ end\n/Font4 exch definefont
      pop\n%%IncludeResource: font Symbol\n/Symbol findfont\ndup length dict
      begin\n \ {1 index /FID ne {def} {pop pop} ifelse} forall\n
      \ currentdict\n \ end\n/Font5 exch definefont pop\n%%EndProlog\n%%Page:
      2 2\nbp\n211.20 313.20 424.80 490.80 cl\n211.20 313.20 424.80 490.80
      cl\n0 0 0 rgb\n0.75 setlinewidth\n[] 0 setdash\nnp\n219.11 319.78
      m\n73.29 8.65 l\n2.79 8.66 l\n21.86 8.65 l\n0.23 8.66 l\n0.43 8.65
      l\n0.95 8.66 l\n7.31 8.65 l\n2.28 8.66 l\n0.54 8.65 l\n1.52 8.66
      l\n0.15 8.65 l\n0.58 8.66 l\n2.64 8.65 l\n6.18 8.66 l\n2.13 8.65
      l\n3.29 8.66 l\n20.37 8.65 l\n15.04 8.66 l\n36.20 8.65 l\no\n162.00
      252.00 450.00 540.00 cl\n0 0 0 rgb\n0.75 setlinewidth\n[] 0
      setdash\nnp\n222.92 313.20 m\n174.34 0 l\no\nnp\n222.92 313.20 m\n0
      -6.00 l\no\nnp\n257.79 313.20 m\n0 -6.00 l\no\nnp\n292.66 313.20 m\n0
      -6.00 l\no\nnp\n327.52 313.20 m\n0 -6.00 l\no\nnp\n362.39 313.20 m\n0
      -6.00 l\no\nnp\n397.26 313.20 m\n0 -6.00 l\no\n/ps 12 def R 12
      s\n222.92 291.60 (7) .5 0 0 t\n257.79 291.60 (8) .5 0 0 t\n292.66
      291.60 (9) .5 0 0 t\n327.52 291.60 (10) .5 0 0 t\n362.39 291.60 (11) .5
      0 0 t\n397.26 291.60 (12) .5 0 0 t\nnp\n211.20 354.40 m\n0 129.82
      l\no\nnp\n211.20 354.40 m\n-6.00 0 l\no\nnp\n211.20 397.67 m\n-6.00 0
      l\no\nnp\n211.20 440.95 m\n-6.00 0 l\no\nnp\n211.20 484.22 m\n-6.00 0
      l\no\n196.80 354.40 (5) .5 0 90 t\n196.80 397.67 (10) .5 0 90 t\n196.80
      440.95 (15) .5 0 90 t\n196.80 484.22 (20) .5 0 90 t\nnp\n211.20 313.20
      m\n213.60 0 l\n0 177.60 l\n-213.60 0 l\n0 -177.60 l\no\n162.00 252.00
      450.00 540.00 cl\n/ps 12 def R 12 s\n0 0 0 rgb\n318.00 267.60
      (sort\\(x\\)) .5 0 0 t\n172.80 402.00 (1:length\\(x\\)) .5 0 90
      t\n211.20 313.20 424.80 490.80 cl\n0 0 0 rgb\n0.75 setlinewidth\n[] 0
      setdash\nnp\n262.58 319.78 m\n25.01 8.65 l\n8.87 8.66 l\n15.10 8.65
      l\n0.62 8.66 l\n0.77 8.65 l\n6.46 8.66 l\n4.01 8.65 l\n11.97 8.66
      l\n7.07 8.65 l\n5.34 8.66 l\n4.78 8.65 l\n5.80 8.66 l\n5.59 8.65
      l\n0.30 8.66 l\n0.42 8.65 l\n19.14 8.66 l\n14.12 8.65 l\n1.96 8.66
      l\n13.71 8.65 l\no\n1 0 0 rgb\nnp\n262.58 319.78 m\n25.01 8.65 l\n8.87
      8.66 l\n15.10 8.65 l\n0.62 8.66 l\n0.77 8.65 l\n6.46 8.66 l\n4.01 8.65
      l\n11.97 8.66 l\n7.07 8.65 l\n5.34 8.66 l\n4.78 8.65 l\n5.80 8.66
      l\n5.59 8.65 l\n0.30 8.66 l\n0.42 8.65 l\n19.14 8.66 l\n14.12 8.65
      l\n1.96 8.66 l\n13.71 8.65 l\no\nnp\n262.58 319.78 m\n25.01 8.65
      l\n8.87 8.66 l\n15.10 8.65 l\n0.62 8.66 l\n0.77 8.65 l\n6.46 8.66
      l\n4.01 8.65 l\n11.97 8.66 l\n7.07 8.65 l\n5.34 8.66 l\n4.78 8.65
      l\n5.80 8.66 l\n5.59 8.65 l\n0.30 8.66 l\n0.42 8.65 l\n19.14 8.66
      l\n14.12 8.65 l\n1.96 8.66 l\n13.71 8.65 l\no\nep\n%%Trailer\n%%Pages:
      2\n%%EOF\n>|ps>||||||>
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  The kolmogov-smirnov test finds the point at which the proportion of points
  is most different, and looks at that maximal difference.

  <with|prog-language|r|prog-session|default|<\session>
    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      ks.test(x,y)
    </input>

    <\output>
      \;

      \ \ \ \ \ \ \ \ Two-sample Kolmogorov-Smirnov test

      \;

      data: \ x and y\ 

      D = 0.35, p-value = 0.1745

      alternative hypothesis: two.sided\ 
    </output>

    <\input|<with|color|red|\<gtr\> <with|color|black|>>>
      \;
    </input>
  </session>>

  \;
</body>

<\initial>
  <\collection>
    <associate|page-even|1in>
    <associate|page-reduce-bot|0.3in>
    <associate|page-reduce-right|0.7in>
    <associate|page-reduce-left|0.7in>
    <associate|page-type|letter>
    <associate|page-top|1in>
    <associate|page-right|1in>
    <associate|par-width|6.5in>
    <associate|page-odd|1in>
    <associate|page-bot|1in>
    <associate|language|english>
    <associate|page-reduce-top|0.3in>
  </collection>
</initial>

<\references>
  <\collection>
    <associate|gly-1|<tuple|1|?>>
    <associate|toc-1|<tuple|<uninit>|?>>
    <associate|toc-2|<tuple|<uninit>|?>>
    <associate|toc-3|<tuple|3.|?>>
    <associate|toc-4|<tuple|3.|?>>
    <associate|toc-5|<tuple|3.|?>>
    <associate|toc-6|<tuple|3.|?>>
    <associate|toc-7|<tuple|3.|?>>
    <associate|toc-8|<tuple|3.|?>>
  </collection>
</references>
