关于R中的对象的问题(应用Wilcox.test时)

发布于 2025-02-04 19:24:19 字数 905 浏览 2 评论 0原文

这并不是真正的必要性,只是我今天的好奇心。我正在将Wilcox.test应用于第一行与标题相对应的数据框架。 我在r上写了这篇文章:

wilcox.test(TK_O$meanF0 [TK_O$Categoria=="Patient"], TK_O$meanF0 [TK_O$Categoria=="Elderly HC"])

    Wilcoxon rank sum test with continuity correction

data:  TK_O$meanF0[TK_O$Categoria == "Patient"] and TK_O$meanF0[TK_O$Categoria == "Elderly HC"]
W = 1207, p-value = 0.986
alternative hypothesis: true location shift is not equal to 0



wilcox.test(TK_O$meanF0Hz [TK_O$Categoria=="Patient"], TK_O$meanF0Hz [TK_O$Categoria=="Elderly HC"])

    Wilcoxon rank sum test with continuity correction

data:  TK_O$meanF0Hz[TK_O$Categoria == "Patient"] and TK_O$meanF0Hz[TK_O$Categoria == "Elderly HC"]
W = 1207, p-value = 0.986
alternative hypothesis: true location shift is not equal to 0

现在,第一行是偶然写的,因为我敢肯定,我的数据框中没有列名为“ Meanf0”的列。正确的版本是Meanf0Hz。 R如何理解我的意思?也许这将有助于我将来更好地理解该软件(如您所见,我仍然不够实用)。

提前致谢!

This is not really a necessity, just a curiosity I had today. I was applying the wilcox.test to a dataframe where the first row corresponds to the header.
I wrote this on R:

wilcox.test(TK_O$meanF0 [TK_O$Categoria=="Patient"], TK_O$meanF0 [TK_O$Categoria=="Elderly HC"])

    Wilcoxon rank sum test with continuity correction

data:  TK_O$meanF0[TK_O$Categoria == "Patient"] and TK_O$meanF0[TK_O$Categoria == "Elderly HC"]
W = 1207, p-value = 0.986
alternative hypothesis: true location shift is not equal to 0



wilcox.test(TK_O$meanF0Hz [TK_O$Categoria=="Patient"], TK_O$meanF0Hz [TK_O$Categoria=="Elderly HC"])

    Wilcoxon rank sum test with continuity correction

data:  TK_O$meanF0Hz[TK_O$Categoria == "Patient"] and TK_O$meanF0Hz[TK_O$Categoria == "Elderly HC"]
W = 1207, p-value = 0.986
alternative hypothesis: true location shift is not equal to 0

Now, the first line was written accidentally, as I'm sure there's no column named "meanF0" in my dataframe. The right version is meanF0Hz. How was it possible for R to understand what I meant? Maybe this will help me to better understand the software in the future (as you can probably see, I'm still not practical enough).

Thanks in advance!

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

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

发布评论

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