Test for Normality of Residuals
A normality plot is a visual way to determine if your error term is normally distributed.
1) Take the residuals from your regression and sort them from lowest to highest.
2) Next, take the observation numbers and paste them to the left of the sorted residuals.
3) Following, you will create the percentile of the distribution that the residual resides in. So, you will use the formula = ((Obs#-0.375)/(1000+0.25)) for the entire range of observations. For example, after you have sorted the observations numbers as listed in step 2, Obs# becomes 1 for the first cell, 2 for the second cell, and so on. When you enter the formula, you can just replace Obs# with whatever cell the observation is in and use autofill.
4) Next, find the inverse of the normal distribution buy using =NORM.S.INV(percentile found in step 3).
5) At this point, you need to create the expected residuals. Multiply the value from step 4 by the square root of the mean squared error (this is found in the ANOVA table from the Regress worksheet labelled MS Residual)
6) Lastly, place the original residuals next to the expected residuals and create a scattergram. What you want to observe is how closely the graph looks linear.
Test for Heteroskedasticity
To do a Bruesch-Pagan test
1) Obtain the residuals from the regression,
2) Obtain the squared residuals (just square the original residuals).
3) Next find the model variance as the sum of squared residuals (SSR) divided by the sample size (n).
4) Then divide the squared residuals by the variance and call this p.
5) Regress p on the independent variables.
6) Get the new explained sum of squares (ESS) and divide that by one half.
7) This result follows a chi-square distribution with k - 1 degrees of freedom where k is the number of regressors including the constant.
8) If test stat is less than critical then there is no evidence of heteroskedasticity
Test for Multicollinearity
To do a VIF
1) Regress each independent variable on all other independent variables.
2) After each regression obtain the R-squared and use the following formula: 1/(1-R2) to get the variance inflation factor for each independent variable.
3) You can also get the average VIF by finding the average of all VIFs
4) Typically, anything that exceeds 10 or if the average is above 8-10, then you have too much collinearity in your variables.
Tests for Misspecification
There are two easy to use model specification tests. The Ramsey RESET test and the linktest. Each tests for misspecification by plugging in the predicted values into either the original equation or a modified equation. If the tests are significant then the model is misspecified, and you need to add a variable(s) to it.
Ramsey RESET
To do the Ramsey RESET test
1) Run original regression and get fitted values.
2) Then rerun the regression with the 2, 3, and 4 powered fitted values. Then use the following:
[(R2ur - R2r)/new regressors] / [(1-R2ur)/(n-df).
where R2ur = r-squared from the unrestricted model
R2r = r-square from the restricted model
new regressors = the powered fitted values
n = the sample size
df = the numerator degrees of freedom
The Ramsey RESET test follows an F distribution with
F~(dfn, dfd, prob)
where dfn = numerator degrees of freedom
dfr = denominator degrees of freedom
prob = probability (specify 0.05)
In Excel, enter the F distribution like this: =F.INV.RT(prob,,dfd, dfn)
3) If the test statistic is not significant at the 5% level then you may assume the model does not suffer from omitted variable bias.
Linktest
The linktest works similar to the Ramsey RESET, except you regress the fitted values and their square on only the dependent variable. For no misspecification you want the squared fitted values to be insignificant at the 5% level.
Two Stage Model with Endogenous Regressor (Two stage least squares)
If you suspect a variable to be endogenous because it is determined within the system or that something else causes it, then you will want to (at a bare minimum) run a two stage least squares model. It's called a TSLS model because there are two stages. The first stage regresses the suspected endogenous variable on all independent variables and what is called an instrument. Instruments are correlated with the endogenous variable but not with the error term. Run this model, then collect the predicted values. These will be used in the second stage.
First Stage
1) Regress the suspected endogenous variable on all the independent variables and any instruments.
2) You will want to collect the predict values from the first stage. These values will be used in the second stage of the model.
3) In the second stage, regress the dependent variable on all the original predictor variables and include the predicted values from the first stage.
Second Stage
1) Take the predicted values and use them in place of the endogenous variable in the main model. The coefficients you get will be consistent and unbiased estimates (assuming the model is specified appropriately) but will not be efficient since the standard errors are wrong.
Correcting Standard Errors
The standard errors produced in the second stage will be wrong, so you need to apply a correction factor to them. To do this, you will need a few pieces of information and calculated residuals, not the ones provided to you by Excel.
1) Take the original data (including the endogenous variable) and place it near the regression output.
2) Find the residuals by multiplying the coefficients by their true values using the following:
Residuals = y – a0 – a1*X1 – a2*X2 - … - an*Xn
Where y = the dependent variable
a0 = the intercept or constant
a1 = the parameter estimate of the predicted variable and X1 = the endogenous variable data
a2 = the parameter estimate of the second variable and X2 = the data for the second variable
an = the parameter estimate of the nth variable and Xn = the data for the nth variable
3) Next, square the residuals from step 2 and sum them.
4) Divide the squared residuals by the (n - # of variables in model)
5) Take the square root of step 5
a. You can do step 3 – 5 in one step by using
=SQRT(SUMSQ(range of obs.)/(n-regression df))
6) Next, find the square root of the mean squared error (MS residual)
7) Divide the step 5 result by the step 6 result. This is the correction factor that needs to be applied to the standard errors for each variable in the second stage of the regression.
8) Copy the regression output and paste it near the correction factor you calculated.
9) Correct the standard errors by multiplying the second stage standard error by the correction factore.
10) Correct the t-stats by dividing the second stage coefficients by the corrected standard error.
11) You can get the corrected p-values by using the following:
=TDIST(ABS(tstat from step10), n-regression df, 2)
ABS is the absolute value of the t-stat from step 10
n-regression df will be the same number used in step 5.
2 represents a two-tail test
Hausman test for endogeneity
After all this is done, we still need to determine if the variable was endogenous. We employ the Hausman test as a way to check this.
1) First return the first stage regression and obtain the errors (residuals).
2) Then regress the dependent variable on all the independent variables not including the instr. variables.
3) Then look at the t-stat on the error variable.
4) If it is significant, then the variable is endogenous and doing a two-stage model was appropriate.