Guest User

Untitled

a guest
Jan 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. PPV = c(0.20, 0.15, 0.25, 0.10, 0.005, 1)
  2. PPV_SE = c(rep(0.05, 5),0,0)
  3. bunch = c(rep("current system",3), rep("comparisons",3))
  4. df <- data.frame(group = c("overall", "low-income", "high-income", "previous system overall", "random guess", "perfect prediction"),
  5. PPV = PPV, lower = PPV - 2*PPV_SE, upper = PPV + 2*PPV_SE,
  6. bunch = bunch)
  7.  
  8. ggplot(df, aes(x = group, y = PPV, fill = bunch)) +
  9. geom_col() +
  10. geom_errorbar(aes(ymin = lower, ymax = upper, color = "95% CI"), width = 0) +
  11. scale_x_discrete(limits = c("overall", "", "previous system overall", "random guess", "perfect prediction", "", "low-income", "high-income")) +
  12. theme(axis.title.x = element_blank(), axis.ticks = element_blank(),
  13. axis.text.x = element_text(angle = 45, vjust = 1, hjust=1),
  14. text = element_text(size=18),
  15. legend.title=element_blank()) +
  16. scale_y_continuous(limits = c(0,1), expand = c(0,0.02)) +
  17. ggtitle("PPV: P[Y=1 | D=1]")
Add Comment
Please, Sign In to add comment