Guest User

Untitled

a guest
Nov 18th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. library(tidyverse)
  2.  
  3. x <- c(20, 28, 30, 35, 41, 50, 51, 57, 60, 65,
  4. 66, 70, 71, 71, 75, 78, 80, 80, 81, 82,
  5. 84, 85, 85, 86, 87, 90, 91, 94, 95, 98,
  6. 99, 100, 100)
  7.  
  8. df <- data.frame(x)
  9.  
  10. # density curve
  11. ggplot(df, aes(x = x)) +
  12. geom_density() +
  13. geom_rug() # shows the raw scores on the x-axis
  14.  
  15. # cumulative density curve
  16.  
  17. ggplot(df, aes(x = x)) +
  18. stat_ecdf(geom = "smooth")
Add Comment
Please, Sign In to add comment