Skip to Content
R 语言经典实例(原书第 2 版)
book

R 语言经典实例(原书第 2 版)

by J.D. Long, Paul Teetor
June 2020
Beginner to intermediate
522 pages
9h 6m
Chinese
China Machine Press
Content preview from R 语言经典实例(原书第 2 版)
线性回归和方差分析
353
每条线都描绘了 time poison 的关系。线之间的区别在于每条线代表不同的 treat
值。这些线应该是平行的,但前两条线并不完全平行。显然,改变 treat 的值会“扭
曲”线条,在 poison time 之间的关系中引入了非线性关系。
这标志着我们应该检查可能存在的交互关系。对于这些数据,它只是恰巧有一个交互关
系,而在统计上并不显著。这里的经验是:可视化检验是有用的,但它并非万无一失。
随后应该跟进一个统计检查。
11.22.4 另请参阅
参见 11.7 节。
11.23 找到组间均值的差异
11.23.1 问题
将数据分组,方差分析表明这些组具有显著不同的均值。你需要知道所有组的均值之间
的差异。
11.23.2 解决方案
使用 aov 函数执行方差分析,该函数返回一个模型对象。然后将 TukeyHSD 函数应用于
该模型对象:
m <- aov(x ~ f)
TukeyHSD(m)
这里,x 是数据,f 是分组因子。你可以绘制 TukeyHSD 的结果以获得差异的图形显示:
plot(TukeyHSD(m))
11.23.3 讨论
方差分析检验非常重要,因为它可以告诉你组间均值是否有差异。但是检验没有确定
组是不同的,并且它也不能显示它们的差异。
TukeyHSD 函数可以计算这些差异,并帮助你识别最大的均值。它使用 John Tukey 发明
的“诚实的显著性差异”方法。
通过继续讨论 11.21 节中的示例来说明函数 TukeyHSD,在 11.21 节中把每日的股票市 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’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
QuotationMarkI 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
QuotationMarkI’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
QuotationMarkI'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.
Mark W.
Embedded Software Engineer

You might also like

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

Aurélien Géron
大规模数据分析和建模:基于 Spark 与 R

大规模数据分析和建模:基于 Spark 与 R

Javier Luraschi, Kevin Kuo, Edgar Ruiz
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111656814