Multivariate regression

In this section, we are adding a second variable to the linear model constructed previously. The function that we use to express the correlation now basically becomes a plane, y = k2x+ k1x+ k0. Just keep in mind that x1 and x2 are different axes/dimensions. To clarify a bit, we can also write it as z = k2y + k1x + k0. Just as described in the beginning of the chapter, we can write this as a matrix multiplication. The variable that we choose to include is an economic variable, the gross domestic product (GDP). As hypothesized before, the economy of the country could affect the suicide rate, as suicide prevention needs a developed medical system that isolates people in need and provides help, which is expensive.

Adding ...

Get Python: End-to-end Data Analysis now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.