在 Matlab 中调整多重比较的 p 值

发布于 2024-12-01 17:18:08 字数 248 浏览 5 评论 0原文

我有一个 p 值元胞数组,必须针对多重比较进行调整。我怎样才能在Matlab中做到这一点?我找不到内置函数。

在RI中会做:

data.pValue_adjusted = p.adjust(data.pValue, method='bonferroni')

Matlab有类似的功能吗?理想情况下,执行不同的调整方法(Bonferroni、Benjamini-Hochberg、FDR ...)?

I have a cell array of p-values that have to be adjusted for multiple comparisons. How can I do that in Matlab? I can't find a built-in function.

In R I would do:

data.pValue_adjusted = p.adjust(data.pValue, method='bonferroni')

Is there a similiar function for Matlab? Ideally one that performs different adjustment methods (Bonferroni, Benjamini-Hochberg, FDR ...)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

卸妝后依然美 2024-12-08 17:18:08

如果您有 Bioinformatics Toolbox,则可以使用 MAFDR 函数来计算调整后的 p 值错误发现率。

If you have Bioinformatics Toolbox, you can use MAFDR function to calculate p-values adjusted by False Discovery Rate.

格子衫的從容 2024-12-08 17:18:08

对于没有生物信息学工具箱的人来说,FDR(错误发现率)方法也有很好的描述 此处,它还提供了 fdr 脚本的链接。

For people without the Bioinformatics Toolbox, the FDR (False Discovery Rate) method is also very nicely described here, it also provides a link with an fdr script.

最初的梦 2024-12-08 17:18:08

R 的 p.adjust 函数的 MATLAB/Octave 实现现已推出

  • Holm
  • Hochberg
  • Hommel
  • Bonferroni
  • BH
  • BY
  • fdr
  • Sidak(R函数中没有这个)

免责声明:我是这个包的作者。

A MATLAB/Octave implementation of R's p.adjust function is available here. It can perform p-value adjustment for multiple comparisons with the following methods, equivalent to their R counterparts:

  • Holm
  • Hochberg
  • Hommel
  • Bonferroni
  • BH
  • BY
  • fdr
  • Sidak (this one is not available in the R function)

Disclaimer: I'm the author of this package.

当爱已成负担 2024-12-08 17:18:08

此提交可能就是您的情况寻找,但它只实现了 Bonferroni-Holm 方法。
您必须在 FEX 中搜索与其他校正方法类似的解决方案。

也就是说,统计工具箱具有 MULTCOMPARE 方法,专为多重比较测试而设计,但它不返回校正的 p 值。这是一个例子:

load fisheriris
[pVal tbl stats] = kruskalwallis(meas(:,1), species)   %# Kruskal-Wallis or ANOVA
title('Sepal Length'), xlabel('Groups'), ylabel('Value')

[c,m] = multcompare(stats, 'ctype','bonferroni', 'display','on');

This submission is probably what you are looking for, but it only implements the Bonferroni-Holm method.
You would have to search the FEX for similar solutions to the other correction methods..

That said the Statistics Toolbox has the MULTCOMPARE method which is designed for multiple comparison tests, though it does not return the corrected p-values. Here is an example:

load fisheriris
[pVal tbl stats] = kruskalwallis(meas(:,1), species)   %# Kruskal-Wallis or ANOVA
title('Sepal Length'), xlabel('Groups'), ylabel('Value')

[c,m] = multcompare(stats, 'ctype','bonferroni', 'display','on');
厌倦 2024-12-08 17:18:08

查看使用 Bonferroni 校正的 T 检验 以及 Matlab 文件交换中的相关文件。

我希望这有帮助。

Have a look at T-test with Bonferroni Correction and related files in the Matlab File-exchange.

I hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文