Skip to content

Instantly share code, notes, and snippets.

@chrissyhroberts
Last active January 30, 2023 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrissyhroberts/aaea2c3af3787331a6a3877310c1a871 to your computer and use it in GitHub Desktop.
Save chrissyhroberts/aaea2c3af3787331a6a3877310c1a871 to your computer and use it in GitHub Desktop.
draw a quick HR and CI with summary values instead of raw data.
require(ggplot2)
bingo<-tibble(
IMD = c("IMD1","IMD2","IMD3","IMD4","IMD5"),
ABSOLUTE.CHANGE = c(-3.1,-6.6,-1.6,-2.0,-0.9),
LCI = c(-0.4,-4.4,0.49,-1.06,-0.2),
UCI = c(-5.7,-8.8,-3.62,-2.9,-1.5)
)
ggplot(bingo,aes(x=IMD,y=ABSOLUTE.CHANGE,colour=IMD))+
geom_errorbar(data=bingo, mapping=aes(x=IMD, y=ABSOLUTE.CHANGE, ymin=LCI, ymax=UCI), width=0.1, linewidth=1)+
geom_point(size=5)+
geom_hline(yintercept = 0,lty=2) +
ylim (-10,10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment