1/24
Looks like no tags are added yet.
Multiple regressions
Allows several independent variables to influence y (dependent variable)
Regression equation becomes
y=a+b1x1+b2x2+bkxk+e
Where the dependent variables are x1, x2 etc.
a = y-intercept
b1, b2 etc. are the regression coefficients - give the amount by which y hat changes when that particular xj increases by one unit with the values of all other independent variables held constant
Why use multiple regressions
Use of several variables isolates the individual effect of each variable
Enables use to hold other things equal/constant while we test for the variable of interest
Example of multiple regression line with variables
y=21.2+18.7x1−0.25x2
Dependent variable Y = selling price pf a house (in thousands of pounds) x1 = number of rooms, x2 = age in years
Intercept = 21.2 - indicates the regression equation intersects the y-axis at 21.2
18.7x1 tells us that for each extra room in a house its value will increase by £18.7k REGARDLESS of its age
−0.25x2 tells us that for each increase of one year in age selling prices will decrease by £0.25k REGARDLESS of the number of rooms
Evaluating a multiple regression equation
Number of degrees of freedom in the regression (k) is now equal to the number of independent variables
Degrees of freedom in the error term is now (n-(k +1))
SSR, SSE and SSTotal all obtained in same way as simple regression was
Multiple standard error of estimate
Comes from sum of squared error residuals - the differences between the predicted and observed values
n−(k+1)SSE
Coefficient of multiple determination
R2 calculated in the same way, and has the same properties as in the simple regression case, except that it measures the percentage of variation in y explained by the WHOLE SET of independent variables
R2=SSTotalSSR
Adjusted coefficient of determination
The R2 will tend to increase as more variables are added to the model, even when the new variables ISN’T a good predictor of the independent variable
To correct for this effect, we use new formula
Radj2=1−n−1SSTotaln−(k+1)SSE
Inference in multiple linear regression - Global test
We can test whether our findings are statistically robust in multiple regressions
Can do so globally - global test investigates whether it’s possible that all the independent variables have ZERO regression coefficients
Step 1: State null hypothesis(H0:β1=β2=β3=0) and the alternative hypothesis (H1: At least one βi is NOT equal to 0)
If we fail to reject the null, then data provides NO evidence any regression coefficient differs from 0 - none of the independent variables are statistically related to the dependent variable
If we DO reject the null we then use an F-test (F=[n−(k+1)]SSEkSSR)
then reject the null that all regression coefficients are zero when F > Fcritical
Inference in multiple linear regression - Individual coefficients
If we reject H0 in global test we THEN look at individual coefficients
If any of them is not statistically different from 0, that implies this variable is of no value in explaining the variation in y, and we can eliminate it from the regression equation
So we will test the null hypothesis that the coefficients are 0
So for each individual variable it will look like this:
H0:β1=0
H0:β1=0 but just replaceβ1 with β2 etc.
Then at the 0.05 significance level using n - (k+1) find the t critical value
Then use t=se(bi)bi−0 - where bi is the coefficient of the first/second etc. variable and se (bi) is the standard error
So if the t < tcritical value we reject H0 and the variable IS significant
If there is a variable that is NOT statistically significant we drop that variable from the regression equation and re-run it with the variables that ARE significant
So need to re-do the global test again - as there should be a lower k, so different F statistic - and then if reject null here go onto another individual coefficients test
Then for the variables left, if null hypothesis is rejected for them we can conclude those variables are useful and significant in influencing the dependent variable
Inference in multiple linear regression - with more variables e.g. 5
Say we have five independent variables and model passes global test
Next we test the coefficients individually and find three are significant and two are not
We should next drop ONLY ONE variable - the single independent variable with the smallest absolute t-value/largest p-value, and return the regression equation with the FOUR remaining variables
Conduct individual tests again - if there are still regression coefficients that are not significant, drop the variable with the smallest absolute t-value
So in summary we should delete ONLY ONE variable at a time - each time we delete a variable we need to rerun the regression equation and check the remaining variables
Assumptions of multiple regression - Overview
There is a linear relationship - relationship between the dependent variable and the independent variables follows a straight-line pattern
The variation in the residuals is the same for both large and small values of y hat
The residuals are normally distributed - (mean = 0)
The independent variables should not be correlated with each other
The residuals are independent - so successive observations of the dependent variable should not be correlated - BUT this is often violated when dealing with time-series data
Assumptions of multiple regression - Linear relationship
For multiple variables we need to look at each in turn - so always visualise the dependent variable plotted against all independent variables separately
Can look at residual plots as well - they display the residuals on the vertical axis against the predictable variable (y hat) on the horizontal axis - and if the plot shows a random distribution of positive and negative values across the entire range of the variable plotted on the x axis there is no reason to doubt the linearity assumption
Although if there is NOT a random distribution then we have reason to doubt the linear assumption and in this case we might try transformations e.g. log, square
Assumptions of multiple regression - Variation in residuals for large and small y hat values
Called homoscedasticity (variation around the regression equation is the same for all of the values of the independent variables) - constant variation in the residuals regardless of whether the predicted values are large or small - AND a violation of this assumption is called heteroscedasticity
E.g. using age as an independent variable to estimate income - we’d expect income to increase with age but we’d ALSO expect income variation to increase with age
Assumptions of multiple regression - Distribution of residuals
We’d like the residuals to follow a normal distribution centered around zero - to evaluate this we can organise the residuals into a frequency distribution and plot it with a histogram
Then if the plotted points are fair close to a straight line drawn from the lower left to upper right of the histogram graph the normal probability plot supports the assumption of normally distributed residuals
Assumptions of multiple regression - Multicollinearity
Multicollinearity exists when independent variables are correlated
In practice it’s nearly impossible to select variables that are completely unrelated but fortunately this doesn’t affect a regression equation’s ability to predict the dependent variable - general rule won’t include two variables if their correlation coefficient falls outside the interval [-0.70, 0.70]
However if there ARE two highly correlated independent variables there may be an unexpected result: a regression coefficient that should have a positive sign turns out to be negative or vice versa - essentially the independent variables are redundant in that they explain the same variation in the dependent variable
May also lead to wrong results in the hypothesis tests for the individual independent variables due to the instability of the standard error of estimate
We can detect multicollinearity if: an independent variable KNOWN to be an important predictor ends up having a regression coefficient that ISN’T significant, or when an independent variable is added or removed there is a drastic change in the values of the remaining regression coefficients
Variance inflation factor
VIF=1−Rj21
where
Rj2 is the coefficient of determination of a regression where xj is the dependent variable
A VIF greater than 10 indicates a problem
Assumptions of multiple regression - Independent observations
Successive residuals should be independent - there shouldn’t be a pattern between them
Long runs of +ve/-ve residuals hint this condition may be violated - called autocorrelation - and often occurs in time series data e.g. periods of positive GDP growth tend to follow each other
A scatter plot showing possible autocorrelation would have a run of residuals above the mean, followed by another run below the mean
Dummy variable
A variable in which there are only two possible outcomes - for analysis one of the outcomes is coded a 1 and the other a 0
We use these when we want to take into consideration QUALITATIVE independent variables e.g. sex and race - useful to evaluate discrimination claims
E.g. imagine we want to compare two exactly identical houses next to each other - one with a garage and the other without - you would assign with a garage the number 1 and without a garage the number 0 - and then calculate the regression line with the other values of the variables as well
(Although there can be qualitative variables that have MORE than two possible outcomes e.g. if a company incl. qualitative info regarding the quarter then for variable x2 1 = if sales were incurred in the first quarter and 0 otherwise, then for variable x3 1 = if sales were incurred in the second quarter and 0 otherwise and the same for x4 but you should stop there, as you always use one fewer variable than the number of possible states
Dummy variable - Hypothesis test
Test in the usual way:
H0:β4=0
H1:β4=0
or whatever number - may not be 4 (depends on amount of variables)
Calculate t-statistic
t=se(b4)b4 and if greater than the tcritical then we can reject the null that the regression coefficient is 0 and conclude there is a statistically significant relationship and the dummy variable SHOULD be included in the analysis
Regression models with interaction
Examine interaction as a separate independent variable
Obtain interaction variable by multiplying the values of the two independent variables whose interaction we want to test, thereby creating a new independent variable
So formula would be
Y=α+β1X1+β2X2+β3X1X2
Then develop a regression equation using the three independent variables and test the significance of the third independent variable using the t-test
H0:β1⋅2=0
H1:β1⋅2=0
With n - (k +1) degrees of freedom
Find critical t value
Then use t-statistic formula
t=se(b1⋅2)b1⋅2 → (1.2 = 1 × 2)
Then if this t-statistic is greater than tcritical value we reject the null and conclude there is a significant interaction effect
Stepwise regression - overview
This technique can help speed up the process of deciding the set of independent variables to include in a regression equation
It efficiently builds an equation that only includes independent variables with significant regression coefficients
Step-by-step method to determine a regression equation that begins with a single independent variable and adds or deletes independent variables one by one.
Only independent variables with NONZERO regression coefficients are included in the final regression equation
Also called forward selection method because we begin with no independent variables and add one independent variable to the regression equation at each iteration
Stepwise regression - advantages
Only independent variables with significant regression coefficients are entered into the equation
The steps involved in building the regression equation are clear
It is efficient in finding the regression equation with only significant regression coefficients
The changes in the multiple standard error of estimate and the coefficient of determination are shown
Backward elimination method
Like stepwise regression - but begins with the entire set of variables and eliminates one independent variable at each iteration
Best-subset regression
We look at the best model using one independent variable, the best model using two independent variables and so on
The criterion is to find the model with the largest R2-value, regardless of the number of independent variables - each independent variable doesn’t necessarily have a nonzero regression coefficient.
Since each independent variable could either be included or not included there are 2k - 1 possible models, where k = number of independent variables
Final review of multiple regression
Calculate correlation matrix for all the independent variables with the dependent variable
Then run the regression with all candidate independent variables
Then conduct the join significance test (H0:β1 =β2 etc.), (H1: At least one βi is not equal to 0
Then decide if we reject null hypothesis. If we DO reject we conclude at least one of the betas is NOT 0
Then we evaluate the coefficients individually - then look for highest p-value (higher than 0.05) - as this shows the regression coefficient is NOT significantly different from 0 - so remove that variable
R2 and adjusted R2 should change - then look for the next highest p-value, and remove this variable - as it is clearly not statistically significant
Then continue doing this until ALL p-values are LESS than 0.05, and thus each remaining independent variables IS a useful predictor of family income
Final step is to very whether the regression assumptions hold in our model and data
e.g. check if there is a linear relationship between each independent and dependent variable (use scatterplot - if points appear linear/scatterplot of residuals - there should be an equal proportion of -ve and +ve residuals centred on zero)
Then check histogram - to make sure it corresponds to a normal distribution
Then carry out a regression analysis for each independent variable as a function of the other independent variables - we need R2 to compute the VIF - and if all of them are less than 10 multicollinearity is not a concern
Write out final regression equation and R2 value tells us the % the equation explains of the variation of the dependent variable.