3 个维度的卡方检验:Cochran–Mantel–Haenszel 检验事后解释

发布于 2025-01-17 06:08:05 字数 2216 浏览 1 评论 0原文

从食品微生物数据中,我有以下变量(仅显示头部):

 TYPE  YEAR     Escherichiacoli
1 Spreadable 2018 Not detected
2 Sliced 2018 Not detected
3 Spreadable 2018 Not detected
4 Pork 2018 Not detected
5 Pork 2018     Detected
6 Spreadable 2018 Not detected

n = 600

所有变量都是分类的。然而,我有3个维度。我想研究每种类型的食品和年份的检测与未检测之间是否存在统计差异。

然后,我想到了 Cochran-Mantel-Haenszel 测试。我没有此类测试的经验。

然而,Cochran–Mantel–Haenszel 测试的示例教程,以及事后分析的详细信息 (https ://rcompanion.org/handbook/H_06.html)我不知道我的解释是否正确。

如果有人同意我的观点或不同意我正确解释每个维度,我会在下面附上上一个网页中详细说明的示例的事后分析的输出。提前致谢。

第三维:

> groupwiseCMH(Table,
+              group   = 3, # Group 3 refers to country (see example in webpage)
+              fisher  = TRUE,
+              gtest   = FALSE,
+              chisq   = FALSE,
+              method  = "fdr",
+              correct = "none",
+              digits  = 3)

        Group   Test p.value  adj.p
1       Bloom Fisher  0.0468 0.0936
2 Cobblestone Fisher  0.0102 0.0408
3      Dougal Fisher  0.5230 0.5230
4    Heimlich Fisher  0.1750 0.2330

然后,我可以说在 Cobblestone 中,通过考试与未通过考试之间存在统计显着差异。

第二维:

> groupwiseCMH(Table,
+              group   = 2,# Variable exam --> two levels: Pass/Fail
+              fisher  = TRUE,
+              gtest   = FALSE,
+              chisq   = FALSE,
+              method  = "fdr",
+              correct = "none",
+              digits  = 3)

  Group   Test p.value adj.p
1  Pass Fisher   0.285 0.285
2  Fail Fisher   0.241 0.285

从这个输出中,我了解到,从全局角度来看,通过或未通过考试之间没有统计差异。

第一维:

> groupwiseCMH(Table,
+              group   = 1, # Variable of Sex.
+              fisher  = TRUE,
+              gtest   = FALSE,
+              chisq   = FALSE,
+              method  = "fdr",
+              correct = "none",
+              digits  = 3)

   Group   Test p.value  adj.p
1 Female Fisher  0.8240 0.8240
2   Male Fisher  0.0121 0.0242

对于这个输出,我可以说男性在通过考试方面存在统计差异,但女性则不然。

如果我正确解释 Cochran-Mantel-Haenszel 测试的事后测试,我真的很感谢您的反馈。谢谢。

From a food microbiological data, I have the following variables (showing only the head):

 TYPE  YEAR     Escherichiacoli
1 Spreadable 2018 Not detected
2 Sliced 2018 Not detected
3 Spreadable 2018 Not detected
4 Pork 2018 Not detected
5 Pork 2018     Detected
6 Spreadable 2018 Not detected

n = 600

All variables are categorical. However, I have 3 dimensions. I want to study if exists statistical differences between detection and not detection for each type of food and year.

Then, I thought that the Cochran–Mantel–Haenszel Test. I don't have experience in this kind of test.

However the example tutorial for the Cochran–Mantel–Haenszel Test, and in detail for their post-hoc analysis (https://rcompanion.org/handbook/H_06.html) I don't know if I interpret it correctly.

I attach below the output for the post-hoc analysis for the example detailed in the previous webpage if someone can agree with me or no that I interpret properly each dimension. Thanks on advance.

Third-dimension:

> groupwiseCMH(Table,
+              group   = 3, # Group 3 refers to country (see example in webpage)
+              fisher  = TRUE,
+              gtest   = FALSE,
+              chisq   = FALSE,
+              method  = "fdr",
+              correct = "none",
+              digits  = 3)

        Group   Test p.value  adj.p
1       Bloom Fisher  0.0468 0.0936
2 Cobblestone Fisher  0.0102 0.0408
3      Dougal Fisher  0.5230 0.5230
4    Heimlich Fisher  0.1750 0.2330

Then, I can say that in Cobblestone there are statistical significant difference between pass or not the exam.

Second-dimension:

> groupwiseCMH(Table,
+              group   = 2,# Variable exam --> two levels: Pass/Fail
+              fisher  = TRUE,
+              gtest   = FALSE,
+              chisq   = FALSE,
+              method  = "fdr",
+              correct = "none",
+              digits  = 3)

  Group   Test p.value adj.p
1  Pass Fisher   0.285 0.285
2  Fail Fisher   0.241 0.285

From this output, I understand that at global terms there are no statistical differences between pass or fail the exam.

First-dimension:

> groupwiseCMH(Table,
+              group   = 1, # Variable of Sex.
+              fisher  = TRUE,
+              gtest   = FALSE,
+              chisq   = FALSE,
+              method  = "fdr",
+              correct = "none",
+              digits  = 3)

   Group   Test p.value  adj.p
1 Female Fisher  0.8240 0.8240
2   Male Fisher  0.0121 0.0242

For this output, I can say that in males, but not for females there are statistical differences in passing the exam.

I really appreciate your feedback if I interpret correctly the post-hoc tests for Cochran–Mantel–Haenszel Test. Thanks.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文