Module 02 · Data Science Topics
Regression回归
Course Text Book: 'Getting Started with Data Science' Publisher: IBM Press; 1 edition (Dec 13 2015) Print.
课程教材:《数据科学入门》 出版社:IBM 出版社;第 1 版(2015 年 12 月 13 日)印刷版。
Author: Murtaza Haider 作者:Murtaza Haider
Prescribed Reading: Chapter 7 Pg. 235-236
推荐阅读:第 7 章 第 235-236 页
Chapter 7. Why Tall Parents Don't Have Even Taller Children 第 7 章。为什么高个子父母不一定有更高个子的孩子
You might have noticed that taller parents often have tall children who are not necessarily taller than their parents and that's a good thing. This is not to suggest that children born to tall parents are not necessarily taller than the rest. That may be the case, but they are not necessarily taller than their own "tall" parents. Why I think this to be a good thing requires a simple mental simulation. Imagine if every successive generation born to tall parents were taller than their parents, in a matter of a couple of millennia, human beings would become uncomfortably tall for their own good, requiring even bigger furniture, cars, and planes.
你可能已经注意到,高个子父母的孩子通常很高,但不一定比父母更高,而这其实是好事。这并不是说高个子父母所生的孩子不比其他人高。情况可能是这样,但他们不一定比自己的"高"父母更高。我认为这是好事的原因需要做一个简单的心理模拟。想象一下,如果每一代高个子父母所生的孩子都比父母高,在几千年后,人类会变得高得令人不适,甚至需要更大的家具、汽车和飞机。
Sir Frances Galton in 1886 studied the same question and landed upon a statistical technique we today know as regression models. This chapter explores the workings of regression models, which have become the workhorse of statistical analysis. In almost all empirical pursuits of research, either in the academic or professional fields, the use of regression models, or their variants, is ubiquitous. In medical science, regression models are being used to develop more effective medicines, improve the methods for operations, and optimize resources for small and large hospitals. In the business world, regression models are at the forefront of analyzing consumer behavior, firm productivity, and competitiveness of public and private sector entities.
弗朗西斯·高尔顿在 1886 年研究了同样的问题,并偶然发现了一种我们今天称之为回归模型的统计技术。本章将探讨回归模型的工作原理,它已成为统计分析的核心工具。在几乎所有学术或专业领域的研究实证中,回归模型或其变体的使用都是普遍存在的。在医学科学中,回归模型被用于开发更有效的药物、改进手术方法以及优化大小医院资源。在商业世界中,回归模型处于分析消费者行为、企业生产力和公共及私营部门实体竞争力的前沿。
I would like to introduce regression models by narrating a story about my Master's thesis. I believe that this story can help explain the utility of regression models.
我想通过讲述我的硕士论文故事来介绍回归模型。我相信这个故事有助于解释回归模型的实用性。
The Department of Obvious Conclusions 明显结论系
In 1999, I finished my Masters' research on developing hedonic price models for residential real estate properties. It took me three years to complete the project involving 500,000 real estate transactions. As I was getting ready for the defense, my wife generously offered to drive me to the university. While we were on our way, she asked, "Tell me, what have you found in your research?". I was delighted to be finally asked to explain what I have been up to for the past three years. "Well, I have been studying the determinants of housing prices. I have found that larger homes sell for more than smaller homes," I told my wife with a triumphant look on my face as I held the draft of the thesis in my hands.
1999 年,我完成了关于开发住宅房地产愉悦价格模型的硕士研究。这个项目涉及 50 万笔房地产交易,历时三年完成。在准备答辩时,我妻子慷慨地提出开车送我去大学。在去学校的路上,她问道:“告诉我,你的研究发现了什么?”我很高兴终于有机会解释过去三年我在做什么。“嗯,我一直在研究房价的决定因素。我发现,面积较大的房子比面积较小的房子售价更高,”我带着胜利的表情,手里拿着论文草稿,对妻子说。
We were approaching the on-ramp for a highway. As soon as I finished the sentence, my wife suddenly turned the car to the shoulder and applied brakes. As the car stopped, she turned to me and said: "I can't believe that they are giving you a Master's degree for finding just that. I could have told you that larger homes sell for more than smaller homes."
我们正接近高速公路的入口。我刚说完这句话,妻子突然把车转向路肩并刹车。车停了下来,她转向我,说:“我简直不敢相信他们就因为这点发现给你颁发硕士学位。我早就可以告诉你,面积较大的房子比面积较小的房子售价更高。”
At that very moment, I felt like a professor who taught at the department of obvious conclusions. How can I blame her for being shocked that what is commonly known about housing prices will earn me a Master's degree from a university of high repute?
就在那时,我感觉自己像是一位在"显而易见结论"系授课的教授。我怎能责怪她因众所周知关于房价的知识能让我从一所声誉卓著的大学获得硕士学位而感到震惊呢?
I requested my wife to resume driving so that I could take the next ten minutes to explain to her the intricacies of my research. She gave me five minutes instead, thinking this may not require even that. I settled for five and spent the next minute collecting my thoughts. I explained to her that my research has not just found the correlation between housing prices and the size of housing units, but I have also discovered the magnitude of those relationships. For instance, I found that all else being equal, a term that I explain later in this chapter, an additional washroom adds more to the housing price than an additional bedroom. Stated otherwise, the marginal increase in the price of a house is higher for an additional washroom than for an additional bedroom. I found later that the real estate brokers in Toronto indeed appreciated this finding.
我请求妻子重新开始驾驶,以便我能用接下来的十分钟向她解释我的研究的复杂之处。她给了我五分钟,认为这可能都不需要那么久。我接受了五分钟,并花了一分钟时间整理思绪。我向她解释说,我的研究不仅发现了房价与住房单元大小之间的相关性,我还发现了这些关系的程度。例如,我发现,在其他条件相同的情况下——这一术语我将在本章后面解释——额外的卫生间比额外的卧室对房价的影响更大。换句话说,增加一个卫生间比增加一个卧室对房价的边际增幅更高。后来我发现,多伦多的房地产经纪人确实欣赏这一发现。
I also explained to my wife that proximity to transport infrastructure, such as subways, resulted in higher housing prices. For instance, houses situated closer to subways sold for more than did those situated farther away. However, houses near freeways or highways sold for less than others did. Similarly, I also discovered that proximity to large shopping centers had a nonlinear impact on housing prices. Houses located very close (less than 2.5 km) to the shopping centers sold for less than the rest. However, houses located closer (less than 5 km, but more than 2.5 km) to the shopping center sold for more than did those located farther away. I also found that the housing values in Toronto declined with distance from downtown.
我也向妻子解释了靠近交通基础设施(如地铁)会导致房价上涨的原因。例如,靠近地铁的房子比远离地铁的房子售价更高。然而,靠近高速公路或国道房子的售价却低于其他房子。类似地,我还发现靠近大型购物中心对房价的影响是非线性的。距离购物中心非常近(小于 2.5 公里)的房子售价低于其他房子。然而,距离购物中心较近(小于 5 公里,但大于 2.5 公里)的房子售价却高于远离的房子。我还发现多伦多的房价随着距离市中心的距离增加而下降。
As I explained my contributions to the study of housing markets, I noticed that my wife was mildly impressed. The likely reason for her lukewarm reception was that my findings confirmed what we already knew from our everyday experience. However, the real value added by the research rested in quantifying the magnitude of those relationships.
在向妻子解释我对住房市场研究的贡献时,我注意到她只是略感惊讶。她反应平淡的可能原因是我的发现证实了我们日常经验中已经知道的事情。然而,这项研究的真正价值在于量化这些关系的程度。
Why Regress? 为什么要回归?
A whole host of questions could be put to regression analysis. Some examples of questions that regression (hedonic) models could address include:
回归分析可以提出许多问题。回归(享乐)模型可以解决的一些问题示例包括:
- How much more can a house sell for an additional bedroom?
增加一个卧室,房屋能多卖多少钱? - What is the impact of lot size on housing price?
地块面积对房价有何影响? - Do homes with brick exteriors sell for less than homes with stone exteriors?
砖砌外墙的房屋是否比石材外墙的房屋售价更低? - How much does a finished basement contribute to the price of a housing unit?
一个完工的地下室对住房单元的价格有多大贡献? - Do houses located near high-voltage power lines sell for more or less than the rest?
靠近高压输电线路的房子,其售价是高于还是低于其他房子?