#> alternative hypothesis: true location shift is not equal to 0
p
值几乎接近于零。从统计学上讲,我们拒绝完成时间相等的假设。实际上,完成时间
不同的结论是合理的。
在此示例中,设置paired=TRUE非常重要。将数据视为未配对是错误的,因为
观察结果不是独立的,按照未配对观测值进行分析可能会产生虚假的结果。使用
paired=FALSE运行示例会产生
p
值0.1022,这会导致错误的结论。
9.16.4 另请参阅
有关参数检验的内容参见9.15 节。
9.17 检验相关系数的显著性
9.17.1 问题
你在计算两个变量的相关系数,但你不知道它在统计意义上是否显著。
9.17.2 解决方案
cor.test函数可以计算相关系数的
p
值和置信区间。如果变量来自正态分布总体,则
使用默认的相关系数算法,即Pearson 方法:
cor.test(x, y)
对于非正态总体,请使用Spearman 方法:
cor.test(x, y, method = "spearman")
该函数返回多个值,包括显著性检验的
p
值。通常,
p
< 0.05表示相关性可能是显著的,
而
p
> 0.05 则表明它不是。
9.17.3 讨论
根据我们的经验,人们往往不对相关系数的显著性进行检验。事实上,许多人并不知道
相关系数可以是不显著的。他们将数据输入计算机 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.