How to add standard deviation to the boxplot?

61 ビュー (過去 30 日間)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020 年 1 月 2 日
コメント済み: Wiqas Ahmad 2021 年 4 月 20 日
Having boxplot, I added mean value by hold on command on the box plot. I wanted to know whether it is common to add standard deviation to the boxplot? Becase boxplot is based on median and quartile I am not sure if it is bizarre to add std to the plot or not. and how to do it?
  1 件のコメント
Wiqas Ahmad
Wiqas Ahmad 2021 年 4 月 20 日
How did you get this plot? I'm trying boxplot to plot the error on my data but unable to do it. Can you show me your code? or just type the boxplotting code?

サインインしてコメントする。

回答 (1 件)

Adam Danz
Adam Danz 2020 年 1 月 2 日
編集済み: Adam Danz 2020 年 1 月 2 日
I wouldn't call it bizarre. Often times it's useful to compare means/medians and IQR/std. It may reveal how skewed your data are. Instead of plotting the means using plot(), you can plot the means and standard deviation using errorbar(x,y,neg,pos,'s') where x are the boxplot centers, y are the means, neg/pos are the -/+ std, and 's' will show a square marker for the mean values.
Or maybe you want to show 2 standard deviations using
errorbar(x, y, -2*std(...), 2*(std...), 's')
  5 件のコメント
Adam Danz
Adam Danz 2020 年 1 月 5 日
編集済み: Adam Danz 2020 年 1 月 6 日
Yes, it makes perfect sense.
3987 + [-33.73, 33.73]
ans =
3953.3 4020.7
Those are the upper and lower bounds of your error bars if you're plotting +/- 1 std. Were you expecting something different?
Adam Danz
Adam Danz 2020 年 1 月 6 日

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeErrorbars についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by