 # Christopher Dougherty EC220 - Introduction to econometrics (chapter 4) Slideshow: interactive explanatory variables Original citation: Dougherty, C. (2012)

## Presentation on theme: "Christopher Dougherty EC220 - Introduction to econometrics (chapter 4) Slideshow: interactive explanatory variables Original citation: Dougherty, C. (2012)"— Presentation transcript:

1 INTERACTIVE EXPLANATORY VARIABLES The model shown above is linear in parameters and it may be fitted using straightforward OLS, provided that the regression model assumptions are satisfied. However, the fact that it is nonlinear in variables has implications for the interpretation of the parameters.

2 INTERACTIVE EXPLANATORY VARIABLES When multiple regression was introduced at the beginning of the previous chapter, it was stated that the slope coefficients represented the separate, individual marginal effects of the variables on Y, holding the other variables constant.

3 INTERACTIVE EXPLANATORY VARIABLES In this model, such an interpretation is not possible. In particular, it is not possible to interpret  2 as the effect of X 2 on Y, holding X 3 and X 2 X 3 constant, because it is not possible to hold both X 3 and X 2 X 3 constant if X 2 changes.

4 INTERACTIVE EXPLANATORY VARIABLES To give a proper interpretation to the coefficients, we can rewrite the model as shown. The coefficient of X 2, (  2 +  4 X 3 ), can now be interpreted as the marginal effect of X 2 on Y, holding X 3 constant.

5 INTERACTIVE EXPLANATORY VARIABLES This representation makes explicit the fact that the marginal effect of X 2 depends on the value of X 3. The interpretation of  2 now becomes the marginal effect of X 2 on Y, when X 3 is equal to zero.

6 INTERACTIVE EXPLANATORY VARIABLES One may equally well rewrite the model as in the third line. From this it may be seen that the marginal effect of X 3 on Y, holding X 2 constant, is (  3 +  4 X 2 ) and that  3 may be interpreted as the marginal effect of X 3 on Y, when X 2 is equal to zero.

7 INTERACTIVE EXPLANATORY VARIABLES If X 3 = 0 is a long way outside its range in the sample, the interpretation of the estimate of  2 as an estimate of the marginal effect of X 2 when X 3 = 0 should be treated with caution.

8 INTERACTIVE EXPLANATORY VARIABLES Sometimes the estimate will be completely implausible, in the same way as the estimate of the intercept in a regression is often implausible if given a literal interpretation.

9 INTERACTIVE EXPLANATORY VARIABLES This can make it difficult to compare the estimates of the effects of X 2 and X 3 on Y in models excluding and including the interactive term.

10 INTERACTIVE EXPLANATORY VARIABLES One way of mitigating the problem is to rescale X 2 and X 3 so that they are measured from their sample means:

11 INTERACTIVE EXPLANATORY VARIABLES Substituting for X 2 and X 3, the model is as shown, with new parameters defined in terms of the original ones.

12 INTERACTIVE EXPLANATORY VARIABLES The point of doing this is that the coefficients of X 2 and X 3 now give the marginal effects of the variables when the other variable is held at its sample mean, which is to some extent a representative value.

13 INTERACTIVE EXPLANATORY VARIABLES For example, rewriting the new equation as the bottom line above, it can be seen that  2 * gives the marginal effect of X 2 *, and hence X 2, when X 3 * = 0, that is, when X 3 is at its sample mean.  2 * has a similar interpretation.

. reg LGEARN S EXP Source | SS df MS Number of obs = 270 -------------+------------------------------ F( 2, 267) = 50.41 Model | 25.4256872 2 12.7128436 Prob > F = 0.0000 Residual | 67.3402828 267.252210797 R-squared = 0.2741 -------------+------------------------------ Adj R-squared = 0.2686 Total | 92.76597 269.344854907 Root MSE =.50221 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.1303979.0129905 10.04 0.000.1048211.1559747 EXP |.0321614.0083783 3.84 0.000.0156655.0486573 _cons |.5969745.2768371 2.16 0.032.0519132 1.142036 ------------------------------------------------------------------------------ 14 INTERACTIVE EXPLANATORY VARIABLES We will illustrate the analysis with a wage equation where the logarithm of hourly earnings is regressed on years of schooling and work experience. We start with a straightforward linear specification, using EAEF Data Set 21..

. reg LGEARN S EXP Source | SS df MS Number of obs = 270 -------------+------------------------------ F( 2, 267) = 50.41 Model | 25.4256872 2 12.7128436 Prob > F = 0.0000 Residual | 67.3402828 267.252210797 R-squared = 0.2741 -------------+------------------------------ Adj R-squared = 0.2686 Total | 92.76597 269.344854907 Root MSE =.50221 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.1303979.0129905 10.04 0.000.1048211.1559747 EXP |.0321614.0083783 3.84 0.000.0156655.0486573 _cons |.5969745.2768371 2.16 0.032.0519132 1.142036 ------------------------------------------------------------------------------ 15 INTERACTIVE EXPLANATORY VARIABLES The regression implies that an extra year of schooling increases earnings by 13.0 percent and that an extra year of work experience increases them by 3.2 percent.

. gen SEXP = S*EXP. reg LGEARN S EXP SEXP Source | SS df MS Number of obs = 270 -------------+------------------------------ F( 3, 266) = 35.58 Model | 26.5654376 3 8.85514586 Prob > F = 0.0000 Residual | 66.2005325 266.248874182 R-squared = 0.2864 -------------+------------------------------ Adj R-squared = 0.2783 Total | 92.76597 269.344854907 Root MSE =.49887 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.2371066.0515064 4.60 0.000.1356944.3385187 EXP |.1226418.0430918 2.85 0.005.0377974.2074863 SEXP | -.0065695.0030699 -2.14 0.033 -.0126139 -.0005252 _cons | -.9003565.7517877 -1.20 0.232 -2.380568.579855 ------------------------------------------------------------------------------ 16 INTERACTIVE EXPLANATORY VARIABLES The interactive variable SEXP is defined as the product of S and EXP and the regression is performed again, including this term.

17 INTERACTIVE EXPLANATORY VARIABLES The schooling coefficient now jumps to 23.7 percent, an extraordinarily high figure. But of course it has now changed its meaning. It now estimates the impact of an extra year of schooling for those individuals who have no work experience.. reg LGEARN S EXP ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.1303979.0129905 10.04 0.000.1048211.1559747 EXP |.0321614.0083783 3.84 0.000.0156655.0486573 _cons |.5969745.2768371 2.16 0.032.0519132 1.142036 ------------------------------------------------------------------------------. gen SEXP = S*EXP. reg LGEARN S EXP SEXP ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.2371066.0515064 4.60 0.000.1356944.3385187 EXP |.1226418.0430918 2.85 0.005.0377974.2074863 SEXP | -.0065695.0030699 -2.14 0.033 -.0126139 -.0005252 _cons | -.9003565.7517877 -1.20 0.232 -2.380568.579855 ------------------------------------------------------------------------------

18 INTERACTIVE EXPLANATORY VARIABLES. reg LGEARN S EXP ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.1303979.0129905 10.04 0.000.1048211.1559747 EXP |.0321614.0083783 3.84 0.000.0156655.0486573 _cons |.5969745.2768371 2.16 0.032.0519132 1.142036 ------------------------------------------------------------------------------. gen SEXP = S*EXP. reg LGEARN S EXP SEXP ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.2371066.0515064 4.60 0.000.1356944.3385187 EXP |.1226418.0430918 2.85 0.005.0377974.2074863 SEXP | -.0065695.0030699 -2.14 0.033 -.0126139 -.0005252 _cons | -.9003565.7517877 -1.20 0.232 -2.380568.579855 ------------------------------------------------------------------------------ The experience coefficient has also risen sharply. Now it indicates that an extra year increases earnings by a wholly implausible 12.3 percent. But this figure refers to individuals with no schooling, and every individual in the sample had at least 8 years.

19 INTERACTIVE EXPLANATORY VARIABLES. sum S EXP Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- S | 270 13.72222 2.575381 8 20 EXP | 270 17.87201 3.993107 1.788462 23.38461. gen S1 = S - 13.72. gen EXP1 = EXP - 17.87. gen SEXP1 = S1*EXP1 We now define S1, EXP1, and SEXP1 as the corresponding schooling, experience, and interactive variables with the means subtracted, and repeat the regressions. We first use the sum (summarize) command to find the mean values of S and EXP.

. reg LGEARN S1 EXP1 Source | SS df MS Number of obs = 270 -------------+------------------------------ F( 2, 267) = 50.41 Model | 25.4256874 2 12.7128437 Prob > F = 0.0000 Residual | 67.3402827 267.252210797 R-squared = 0.2741 -------------+------------------------------ Adj R-squared = 0.2686 Total | 92.76597 269.344854907 Root MSE =.50221 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S1 |.1303979.0129905 10.04 0.000.1048211.1559747 EXP1 |.0321614.0083783 3.84 0.000.0156655.0486573 _cons | 2.960757.0305633 96.87 0.000 2.900582 3.020933 ------------------------------------------------------------------------------ 20 INTERACTIVE EXPLANATORY VARIABLES Here is the regression without the interactive term. The top half of the output is identical to that when LGEARN was regressed on S and EXP. What differences do you expect in the bottom half?

. reg LGEARN S1 EXP1 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S1 |.1303979.0129905 10.04 0.000.1048211.1559747 EXP1 |.0321614.0083783 3.84 0.000.0156655.0486573 _cons | 2.960757.0305633 96.87 0.000 2.900582 3.020933 ------------------------------------------------------------------------------. reg LGEARN S EXP ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.1303979.0129905 10.04 0.000.1048211.1559747 EXP |.0321614.0083783 3.84 0.000.0156655.0486573 _cons |.5969745.2768371 2.16 0.032.0519132 1.142036 ------------------------------------------------------------------------------ 21 INTERACTIVE EXPLANATORY VARIABLES The slope coefficients (and their standard errors and t statistics) are exactly the same as before. Only the intercept has been changed by subtracting the means from S and EXP.

. reg LGEARN S1 EXP1 SEXP1 Source | SS df MS Number of obs = 270 -------------+------------------------------ F( 3, 266) = 35.58 Model | 26.5654377 3 8.85514591 Prob > F = 0.0000 Residual | 66.2005323 266.248874182 R-squared = 0.2864 -------------+------------------------------ Adj R-squared = 0.2783 Total | 92.76597 269.344854907 Root MSE =.49887 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S1 |.1197091.0138372 8.65 0.000.0924649.1469534 EXP1 |.0325079.0083243 3.91 0.000.0161181.0488977 SEXP1 | -.0065695.0030699 -2.14 0.033 -.0126138 -.0005252 _cons | 2.933662.0328947 89.18 0.000 2.868895 2.99843 ------------------------------------------------------------------------------ 22 INTERACTIVE EXPLANATORY VARIABLES Here is the output from the regression using S and EXP with means extracted, with their interactive term. The top half of the output is identical to that when LGEARN was regressed on S, EXP, and SEXP.

. reg LGEARN S1 EXP1 SEXP1 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S1 |.1197091.0138372 8.65 0.000.0924649.1469534 EXP1 |.0325079.0083243 3.91 0.000.0161181.0488977 SEXP1 | -.0065695.0030699 -2.14 0.033 -.0126138 -.0005252 _cons | 2.933662.0328947 89.18 0.000 2.868895 2.99843 ------------------------------------------------------------------------------. reg LGEARN S EXP SEXP ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.2371066.0515064 4.60 0.000.1356944.3385187 EXP |.1226418.0430918 2.85 0.005.0377974.2074863 SEXP | -.0065695.0030699 -2.14 0.033 -.0126139 -.0005252 _cons | -.9003565.7517877 -1.20 0.232 -2.380568.579855 ------------------------------------------------------------------------------ 23 INTERACTIVE EXPLANATORY VARIABLES However the bottom half is different. The coefficients of S1 and EXP1 measure the effects of those variables for the mean value of the other variable, that is, for a ‘typical’ individual. The coefficients of S and EXP measures their effects when the other variable is zero.

. reg LGEARN S1 EXP1 SEXP1 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S1 |.1197091.0138372 8.65 0.000.0924649.1469534 EXP1 |.0325079.0083243 3.91 0.000.0161181.0488977 SEXP1 | -.0065695.0030699 -2.14 0.033 -.0126138 -.0005252 _cons | 2.933662.0328947 89.18 0.000 2.868895 2.99843 ------------------------------------------------------------------------------. reg LGEARN S EXP SEXP ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.2371066.0515064 4.60 0.000.1356944.3385187 EXP |.1226418.0430918 2.85 0.005.0377974.2074863 SEXP | -.0065695.0030699 -2.14 0.033 -.0126139 -.0005252 _cons | -.9003565.7517877 -1.20 0.232 -2.380568.579855 ------------------------------------------------------------------------------ 24 INTERACTIVE EXPLANATORY VARIABLES Note that the coefficient of the interactive term is the same. It measures the change in the schooling coefficient per unit (one year) change in experience and is unaffected by the extraction of the means. (It also measures the change in the experience coefficient per unit change in schooling.)

. reg LGEARN S1 EXP1 SEXP1 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S1 |.1197091.0138372 8.65 0.000.0924649.1469534 EXP1 |.0325079.0083243 3.91 0.000.0161181.0488977 SEXP1 | -.0065695.0030699 -2.14 0.033 -.0126138 -.0005252 _cons | 2.933662.0328947 89.18 0.000 2.868895 2.99843 ------------------------------------------------------------------------------. reg LGEARN S1 EXP1 ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S1 |.1303979.0129905 10.04 0.000.1048211.1559747 EXP1 |.0321614.0083783 3.84 0.000.0156655.0486573 _cons | 2.960757.0305633 96.87 0.000 2.900582 3.020933 ------------------------------------------------------------------------------ 25 INTERACTIVE EXPLANATORY VARIABLES With the means-extracted variables, we can see more clearly the impact of including the interactive term. If we assume that it should be in the model, omitting it causes the schooling coefficient to be upwards biased but does not have much effect on the experience coefficient.

.reg LGEARN S EXP SEXP ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.2371066.0515064 4.60 0.000.1356944.3385187 EXP |.1226418.0430918 2.85 0.005.0377974.2074863 SEXP | -.0065695.0030699 -2.14 0.033 -.0126139 -.0005252 _cons | -.9003565.7517877 -1.20 0.232 -2.380568.579855 ------------------------------------------------------------------------------. reg LGEARN S EXP ------------------------------------------------------------------------------ LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- S |.1303979.0129905 10.04 0.000.1048211.1559747 EXP |.0321614.0083783 3.84 0.000.0156655.0486573 _cons |.5969745.2768371 2.16 0.032.0519132 1.142036 ------------------------------------------------------------------------------ 26 INTERACTIVE EXPLANATORY VARIABLES For comparison, here again are the corresponding results with the original variables, where the introduction of the interactive term appears to have a dramatic effect.

Copyright Christopher Dougherty 2011. These slideshows may be downloaded by anyone, anywhere for personal use. Subject to respect for copyright and, where appropriate, attribution, they may be used as a resource for teaching an econometrics course. There is no need to refer to the author. The content of this slideshow comes from Section 4.3 of C. Dougherty, Introduction to Econometrics, fourth edition 2011, Oxford University Press. Additional (free) resources for both students and instructors may be downloaded from the OUP Online Resource Centre http://www.oup.com/uk/orc/bin/9780199567089/http://www.oup.com/uk/orc/bin/9780199567089/. Individuals studying econometrics on their own and who feel that they might benefit from participation in a formal course should consider the London School of Economics summer school course EC212 Introduction to Econometrics http://www2.lse.ac.uk/study/summerSchools/summerSchool/Home.aspx http://www2.lse.ac.uk/study/summerSchools/summerSchool/Home.aspx or the University of London International Programmes distance learning course 20 Elements of Econometrics www.londoninternational.ac.uk/lsewww.londoninternational.ac.uk/lse. 11.07.25

Download ppt "Christopher Dougherty EC220 - Introduction to econometrics (chapter 4) Slideshow: interactive explanatory variables Original citation: Dougherty, C. (2012)"

Similar presentations