adding confidence intervals/error bars to ggplot

Hello all,

I'm trying to figure out how to add custom error bars to a ggplot figure to represent the uncertainty in the point estimates for some WAIS-IV scale scores. The confidence intervals are coming from the manual, not from a computed model, so I'm not sure how to add them into the graph. Ideally, I would like them to look just like the default error bars do, but I need the lower and upper bounds to be the numbers in my tibble. Here's my code:

results=tribble(
~Scale,	  ~Sum_of_Scaled_Scores,	~Composite_Score,	    ~Percentile_Rank,     ~Conf_low, ~Conf_high,
 "VCI",        	15,	              72,       	              "3",                69,        81,
 "PRI",	        14,	              69,                     "2",                 64,       77,
 "WMI",	        9,	              69, 	                  "2",                	64,      78,
 "PSI", 	      2,             	50,                   	"<0.1",	              47,      63,
 "FSIQ",        40,             60,                      "0.4",	              57,       65
)


ggplot(data = results, aes(x= Scale, y=Composite_Score)) + 
  geom_point() +
  coord_cartesian(ylim = c(45, 135)) + 
  theme_classic()

I have the feeling I am missing something here but

ggplot(data = dat1, aes(x= Scale, y=Composite_Score)) + 
  geom_point() +
  coord_cartesian(ylim = c(45, 135)) + 
  theme_classic() +
   geom_errorbar(aes(ymin = Conf_low  , ymax = Conf_high))
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.