**boxplot**in R, it automatically computes median, first and third quartile ("

*hinges*") and 95% confidence interval of median ("

*notches*").

But we would like to change the default values of boxplot graphics with the

**mean**, the mean + standard deviation, the mean - S.D., the min and the max values.
Here is an example solved using

**ggplot2**package. Plus here are represented points (the single values) jittered horizontally.
the code doesnt work for me

ReplyDelete"we would like to change the default values of boxplot graphics"

ReplyDeleteHave you also considered changing the value of pi to 2.0 and renaming the mean as "the Oxford-Meier-Blubb"? Please, don't do any of these three. There are enough recipients struggeling with the meaning of a boxplot. If there finally are boxplot-like-figures that are not boxplots, it's going to hurt. Please find an alternative way to display the results.

Cheers,

Bernhard

@Duleep Samuel

ReplyDeleteat the end of the code, type: print(p1)

thanks for rectifying, now the code rocks

ReplyDeleteWonderful! I'm writing a report with a deadline coming soon, and this is exactly what I needed!

ReplyDeleteCiao!

Hi, great post, but... i have a question, your function calculate the mean-sd, mean+sd, which i consider is the box of the boxplot, and min and max values, which i supose are the bars... but why the graph title says: 95%CI? not should be "mean +-SD?

ReplyDeleteyour point is valid! it is not 95% CI. This is 68% and if you want to have 95% CI you should change the function to mean(x) -+ 3*sd(x)

Delete