Skip to content

Instantly share code, notes, and snippets.

@indapa
Created June 14, 2012 15:31
Show Gist options
  • Save indapa/2930996 to your computer and use it in GitHub Desktop.
Save indapa/2930996 to your computer and use it in GitHub Desktop.
Plot empirical CDF function in R
#plot the empirical CDF
x=rnorm(100) # 100 random draws from standard normal
f=ecdf(x) # ecdf returns a function
percentiles=f(x) # return the percentiles of the data points
plot(percentiles, x)
#see ?ecdf for more information
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment