title: Visualizing the Kolmogorov-Smirnov statistic in ggplot2
body: <p>The Kolmogorov-Smirnov statistic is defined as the maximum distance between the empirical and the hypothesized cumulative distribution function. Rather than looking at numbers, I think it is much preferable to locate the maximum difference using a graph. </p>
  
  <p>I know how to plot the empirical distribution function</p>
  
  <blockquote>
    <p>p1&lt;-qplot(rnorm(30),stat="ecdf",geom="step")</p>
  </blockquote>
  
  <p>but could you please tell me how I could add on the same plot the cumulative distribution function of the theoretical distribution? For my case, the theoretical distribution is the standard normal but I am interested in the generalization to every distribution function.</p>
  
  <p>Thank you.</p>