Christopher Dougherty EC220 - Introduction to econometrics (chapter 4) Slideshow: interactive explanatory variables Original citation: Dougherty, C. (2012) EC220 - Introduction to econometrics (chapter 4). [Teaching Resource] © 2012 The Author This version available at: Available in LSE Learning Resources Online: May 2012 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. This license allows the user to remix, tweak, and build upon the work even for commercial purposes, as long as the user credits the author and licenses their new creations under the identical terms
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 = F( 2, 267) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | _cons | 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 = F( 2, 267) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | _cons | 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 = F( 3, 266) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | SEXP | _cons | 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 | EXP | _cons | gen SEXP = S*EXP. reg LGEARN S EXP SEXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | SEXP | _cons |
18 INTERACTIVE EXPLANATORY VARIABLES. reg LGEARN S EXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | _cons | gen SEXP = S*EXP. reg LGEARN S EXP SEXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | SEXP | _cons | 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 | EXP | gen S1 = S gen EXP1 = EXP 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 = F( 2, 267) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S1 | EXP1 | _cons | 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 EXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S1 | EXP1 | _cons | reg LGEARN S EXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | _cons | 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 = F( 3, 266) = Model | Prob > F = Residual | R-squared = Adj R-squared = Total | Root MSE = LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S1 | EXP1 | SEXP1 | _cons | 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 SEXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S1 | EXP1 | SEXP1 | _cons | reg LGEARN S EXP SEXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | SEXP | _cons | 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 SEXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S1 | EXP1 | SEXP1 | _cons | reg LGEARN S EXP SEXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | SEXP | _cons | 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 SEXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S1 | EXP1 | SEXP1 | _cons | reg LGEARN S1 EXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S1 | EXP1 | _cons | 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 | EXP | SEXP | _cons | reg LGEARN S EXP LGEARN | Coef. Std. Err. t P>|t| [95% Conf. Interval] S | EXP | _cons | 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 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 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 or the University of London International Programmes distance learning course 20 Elements of Econometrics