## Multiple Regression.

###
*Reflections on a complex tool.*

Anybody with a basic math background knows the equation of a line is

**. We also know that the concept of Regression is to find a line that better adjusts or "***y = a + bx**fits"*our data on a particular plane. Let us take, for example,*y= 3+2x*and add a random number from a normal distribution with a mean of 0 and s=5 to create some dispersion. There are many considerations for a sample size to be "enough" for Regression but let's take 40 as a rule of thumb (never less than 15). Those points on a graph could look like this:
After fitting the regression line and adding a Confidence Interval (95%; green dotted lines in the image below), the graph will now show an area of probability where the true line is.

It can also be observed that approximately 95% of the variation in "

**"***y*__could__be explained by the variation in "**" (R-sq = 95%). Also, S=5 (which we already knew) means the line equation +/- 2S should cover the area of where the value of "***x**y*" truly is at least 95% of the time (property of normal distribution).
But this is all for the data that's

*already there.*If we wanted to guess where the__next__value of "**" is going to fall using that same range for "***y**x*" then we use the Prediction Interval (95%; orange dotted lines in the image below).
This should be no surprise to anybody as it is obvious that your ability to predict where the next point is going to land depends on the overall variation of the system. Is like trying to throw an arrow with a shaking hand: most likely it will not land on the exact same place!

Now let's add another axis using a different variable in an attempt to explain "

**" better. This would add depth to our graph and we'll be working on a tridimensional space.***y*
Because of software and time limitations, let's imagine: if you fit the line for "

This is only important where the regression equation is

*" and "***y***" and then extended across "***X1****" you have a plane (like ironing the wrinkles on the graph above). If the regression line remains at the exact same height it means that "***X2***" has no***X2*__interaction__with "**". You can also add the Confidence and Prediction Intervals on the top and bottom of that plane. From here a lot of reflections can be made (some mindblowing): what's happening if the "***X1***" regression line twists across "***X1***" (like a helix)? what if it bends while traveling thru "***X2***"***X2*This is only important where the regression equation is

**y = a + b(X1*X2).**If there is no significant interaction and the equation is**y = a + bX1 + cX2,**then it could be seen as if the original regression with "**" just gets tilted by the presence of "***X1***"... a much simpler case.***X2*
Anyway, multiple regression means that at least two variables are having a significant effect on the output been measured. The situation gets more complex as you add more "

**" and they interact in different ways (like in real life, isn't it?) and even more if different types of variables are added (i.e. ordinal attributes).***Xs*
Regardless of how hard it gets, it is always beneficial to try to visualize it. The better the intuition, the fewer chances we are lost in the numbers.

Nice

ReplyDelete