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