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 = k2x2 + k1x1 + 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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.