title: Differences in ecdf() and Ecdf() on R
body: <p>I am trying to plot this kind of <a href="https://stats.stackexchange.com/questions/30864/estimating-alpha-parameter-in-a-stable-distribution">behaviour</a> of a data set. I have tried with Ecdf()</p>
  
  <pre><code>library(Hmisc)
  dd&lt;-read.table('critical.1.dat',head=F)
  cdf&lt;-Ecdf(dd$V1)
  df&lt;-hist(dd$V1)
  ll&lt;-((1-cdf$y[df$mids])/(df$density))
  plot(df$mids,ll)
  </code></pre>
  
  <p>and seems all goes fine. After this <a href="https://stats.stackexchange.com/questions/30858/cumulative-distribution-in-r">answer</a> i have tried with ecdf()</p>
  
  <pre><code>dd&lt;-read.table('critical.1.dat',head=F)
  cdf&lt;-ecdf(dd$V1)
  df&lt;-hist(dd$V1)
  ll&lt;-(1-cdf(df$mids))/df$density
  plot(df$mids,ll)
  </code></pre>
  
  <p>and the outcome looks very different Ecdf().  </p>
  
  <p>Where is my mistake? why they looks me different?</p>
  
  <p>First Edit: My actual code is</p>
  
  <pre><code>library(Hmisc)
  dd&lt;-read.table('critical.1.dat',head=F)
  
  cdf&lt;-Ecdf(dd$V1)
  ccdf&lt;-ecdf(dd$V1)
  
  df&lt;-hist(dd$V1)
  
  ll&lt;-((1-cdf$y[df$mids])/(df$density))
  llc&lt;-(1-ccdf(df$mids))/df$density
  
  par( mfrow = c( 2, 1 ) )
  
  plot(df$mids,ll,ylab='Ecdf()')
  plot(df$mids,llc,ylab='ecdf()')
  </code></pre>