EC10004 Lecture 10: Regression Analysis and Microfit Fitted Values and the Residual As already mentioned when running a regression, the dependent variable is made up of a fitted value (one that lies on the regression schedule) and a residual (the degree to which the actual value lies away from the regression schedule). In Microfit we can view the plots of both the fitted values and actual values of the dependent variable, this provides us with important information about how well the model fits the data. For instance, if the fitted values and actual values move together over time, the model fits the data reasonably well. To view these plots, after running the regression click close and in the post regression menu, choose option 3: list, plot, save fitted …. Then choose plot actual and fitted values. Y X e In addition the variance of the dependent variable can be decomposed into explained and unexplained components. Var ( y ) Var ( yˆ ) Var (e) This is often referred to as the Total Sum of squares being equal to the Explained sum of squares and the residual sum of squares’ TSS ESS RSS The residual sum of squares is simply the residual or error term (e), squared, then summed. Microfit produces it automatically as it is used to test restrictions and hypothesis tests. It is also possible to plot the residual in Microfit, again having run the regression, choose the List, plot etc option in the post regression menu, then the plot residual option. Again this plot offers us some important information about our regression, as we assume the residual is a random variable, which is distributed normally. We can also save the residual, using an option from the same screen. We can then perform some standard tests on the residual or use it as a variable in a secondary regression. Testing a Specific Model Regression analysis is often used to test a specific model. For instance the Keynesian consumption function, whereby consumption is regressed against income. If the coefficient on the income variable is positive and about 0.8 we would conclude the model holds. In addition we could use a simple t-test to ensure both the constant and income variable were statistically significant. (In fact there are a variety of other diagnostic checks which would be required before we could conclude this with any certainty, but you will come across these next year). Another important test for any model is how well it forecasts, particularly out of sample. This means the regression is carried out on most of the data, with a number of observations left out, so they can be used for the forecast. Again it is fairly easy to carry out this test in Microfit, as there is a forecast option in the post regression menu. However to produce a dynamic forecast, you will need to include some lagged variables amongst the explanatory variables. Microfit produces a plot of the actual values and forecast values of the dependent variable, in the forecast time period. You need to note not just how well the variable is forecast, but also does the forecast follow the same ‘turning points’ as the actual values. We can also assess the prediction or forecast error ( f T p ), which is defined as: fT p yˆT p yT p This implies that the error is equal to the difference between the forecast and actual values. Forecasting is one of the most common uses for statistics and econometrics and some argue the most important test for any model is how well it forecasts. Demo 1. Using data on UK real income and consumption from here, using Microfit, carry out the following steps: 1) Create a constant and logs of the variables. 2) Plot the data together, they follow a similar pattern. 3) Run a regression of lrc constant lry, interpret the results 4) Then go to the list, plot, save residuals… page and plot the fitted and actual values. 5) Plot the residual, does it follow any pattern or is it reasonably random ? 6) Save the residual, then in the estimation window, test the model: residual constant residual(-1), note if it is significant. Demo 2. Using data for Canada and the UK exchange rate and prices from here, we are going to test the UK and Canada, to determine if purchasing power parity (PPP) holds. 1) Create a constant and take logs of the variables. 2) Run the regression: lcue constant lukp lcnp. If PPP works the lukp and lcnp should have equal and oppositely signed coefficients, which are highly significant. Is this the case? 3) We also want to use this model to forecast the exchange rate after 2000. To do this rerun the regression from 1980 to 2000. The final observations will then be used for the forecast. 4) Assess the accuracy of the forecast.