Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggerrorplot median_iqr #209

Closed
davidlorenz opened this issue Sep 11, 2019 · 1 comment
Closed

ggerrorplot median_iqr #209

davidlorenz opened this issue Sep 11, 2019 · 1 comment

Comments

@davidlorenz
Copy link

Thanks so much for developing and maintaining this great package! An issue I noticed is that the "median_iqr" descriptive stat for errors plots the median +/- IQR, which seems unusual (many people might assume that the ymin/ymax values would correspond to the 25th/75th percentiles, as in a box plot). You might want to add the option to specify confidence intervals (as in Hmisc::smedian.hilow). Thanks again.

ggerr <- ggerrorplot(ToothGrowth, x = "dose", y = "len", desc_stat="median_iqr") + ylim(0,40) ggbox <- ggboxplot(ToothGrowth, x = "dose", y = "len") + ylim(0, 40) gridExtra::grid.arrange(ggerr, ggbox, nrow=1) ToothGrowth %>% dplyr::group_by(dose) %>% dplyr::summarise(IQR(len))

ggpubr_median_iqr

@davidlorenz davidlorenz changed the title ggerrplot median_iqr ggerrorplot median_iqr Sep 11, 2019
@kassambara
Copy link
Owner

New errorbar functions added now, thanks

library(ggpubr)
# Error plot
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Use this
ggerr <- ggerrorplot(
  ToothGrowth, x = "dose", y = "len", 
  desc_stat="median_hilow", ci = 0.5
  ) + 
  ylim(0,40) 
# Or this
ggerr <- ggerrorplot(
  ToothGrowth, x = "dose", y = "len", 
  desc_stat="median_q1q3"
) + 
  ylim(0,40) 
# Box plot
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ggbox <- ggboxplot(ToothGrowth, x = "dose", y = "len") + 
  ylim(0, 40) 
gridExtra::grid.arrange(ggerr, ggbox, nrow=1) 

Created on 2020-05-08 by the reprex package (v0.3.0.9001)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants