With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

Polynomial Regression

The relationship between y and x often turns out not to be a straight line. However, Occam's razor requires that we fit a straight-line model unless a non-linear relationship is significantly better at describing the data. So this begs the question: how do we assess the significance of departures from linearity? One of the simplest ways is to use polynomial regression.

The idea of polynomial regression is straightforward. As before, we have just one continuous explanatory variable, x, but we can fit higher powers of x, such as x2 and x3, to the model in addition to x to explain curvature in the relationship between y and x. It is useful to experiment with the kinds of curves that can be generated with very simple models. Even if we restrict ourselves to the inclusion of a quadratic term, x2, there are many curves we can describe, depending upon the signs of the linear and quadratic terms:

In the top left-hand panel, there is a curve with positive but declining slope, with no hint of a hump (y = 4 + 2x − 0.1x2). The top right-hand graph shows a curve with a clear maximum (y = 4 + 2x − 0.2x2), and at bottom left we have a curve with a clear minimum (y = 12 − 4x + 0.35x2). The bottom right-hand curve shows a positive association between y and x with the slope increasing as x increases (y = 4 + 0.5x + 0.1x2). So you can see that a simple quadratic model with three parameters (an intercept, a slope for x, and a slope for x2) is capable of describing a wide range ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required
{"ft_lang_label":"__label__en","ft_lang_prob":0.9210179,"math_prob":0.9853252,"size":1509,"snap":"2019-26-2019-30","text_gpt3_token_len":361,"char_repetition_ratio":0.093023255,"word_repetition_ratio":0.02166065,"special_character_ratio":0.24453281,"punctuation_ratio":0.10897436,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98893654,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-06-20T08:11:00Z\",\"WARC-Record-ID\":\"<urn:uuid:c22633b4-0ec8-4261-a591-ef7d87ed3f16>\",\"Content-Length\":\"25692\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:09146f93-097e-40e6-b526-79c40182372a>\",\"WARC-Concurrent-To\":\"<urn:uuid:be8b451d-7a18-4792-8158-e6d62e6c7a17>\",\"WARC-IP-Address\":\"104.106.251.182\",\"WARC-Target-URI\":\"https://www.oreilly.com/library/view/the-r-book/9780470510247/ch010-sec010.html\",\"WARC-Payload-Digest\":\"sha1:B7R6Q6ALPCWYNGLRHTOMHGQKEE3T7VVU\",\"WARC-Block-Digest\":\"sha1:AQLCBM4UZRSRFQGHJZY4O4XGM7HCDOTV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-26/CC-MAIN-2019-26_segments_1560627999163.73_warc_CC-MAIN-20190620065141-20190620091141-00183.warc.gz\"}"}