【源码】notBoxPlot:绘制原始(分组)数据以及平均值、95%置信区间和1 SD

在这里插入图片描述

虽然使用箱形图有合理的地方,但有时查看所有数据比采用汇总统计数据(如四分位距)的效果更好。

Whilst box plots have their place, it’s sometimes nicer to see all the data, rather than hiding them with summary statistics such as the inter-quartile range.

本函数解决了这一问题。

This function (with a tongue in cheek name) addresses this problem.

用平均值代替中间值,用SEM和SD代替四分位数和whisker。

The use of the mean instead of the median and the SEM and SD instead of quartiles and whiskers are deliberate.

绘制抖动的原始数据。

Jittered raw data are plotted for each group.

图中还显示平均值和平均值的95%置信区间。

Also shown are the mean, and 95% confidence intervals for the mean.

这种绘图样式设计用于参数检验,如方差分析和t检验。

This plotting style is designed to be used alongside parametric tests such as ANOVA and the t-test.

将抖动数据与误差条进行比较,可以直观地反映是否违反了统计检验的正态性假设。

Comparing the jittered data to the error bars provides a visual indication of whether the normality assumptions of the statistical tests are being violated.

此外,允许通过观察数据,以寻找平均值之间的显著差异(不重叠的置信区间表示所选p值的显著差异,这里为5%)。

Furthermore, it allows one to eyeball the data to look for significant differences between means (non-overlapping confidence intervals indicate a significant difference at the chosen p-value, which here is 5%).

最后,还可以显示1 SD值。

Finally, 1 SD is also shown.

注意,如果数据不是正态分布的,那么这些统计就没有意义了。

Note that if data are not normally distributed then these statistics will be less meaningful.

notBoxPlot.m - 生成如上图所示的绘图结果

notBoxPlot.m - generates plots as shown in screenshot

NBP.SEM_calc.m - 计算平均值的标准差。

NBP.SEM_calc.m - calculate standard error of the mean.

NBP.tInterval_calc.m - 计算t-区间。对于较小的采样尺寸,t-区间大于SEM。

NBP.tInterval_calc.m - calculate a t-interval. For small sample sizes, the t-interval is larger than the SEM.

NBP.example - 制作一幅优秀的示例图。

NBP.example - makes a nice example plot.

完整源码下载地址:

http://page2.dfpan.com/fs/alc5j27211298165c57/

更多精彩文章请关注微信号:在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值