













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














Wooldridge, Introductory Econometrics, 4th ed.
Chapter 7: Multiple regression analysis with qualitative information: Binary (or dummy) variables
We often consider relationships between ob- served outcomes and qualitative factors: mod- els in which a continuous dependent variable is related to a number of explanatory factors, some of which are quantitative, and some of which are qualitative. In econometrics, we also consider models of qualitative dependent vari- ables, but we will not explore those models in this course due to time constraints. But we can readily evaluate the use of qualitative in- formation in standard regression models with continuous dependent variables.
Qualitative information often arises in terms of some coding, or index, which takes on a
number of values: for instance, we may know in which one of the six New England states each of the individuals in our sample resides. The data themselves may be coded with the biliteral “MA”, “RI”, “ME”, etc. How can we use this factor in a regression equation? In the data, state takes on six distinct val- ues. We must create six binary variables, or dummy variables, each of which will refer to one state–that is, that variable will be 1 if the individual comes from that state, and 0 oth- erwise. We can generate this set of 6 vari- ables easily in Stata with the command tab state, gen(st), which will create 6 new vari- ables in our dataset: st1, st2, ... st6. Each of these variables are dummies–that is, they only contain 0 or 1 values. If we add up these variables, we get–exactly–a vector of 1’s, sug- gesting that we will never want to use all 6 variables in a regression (since by knowing the values of any 5...) We may also find the pro- portions of each state’s citizens in our sample
H 0 : μ 1 = μ 2 = μ 3 = μ 4 = μ 5 = μ 6 (2)
versus the alternative that not all six of the state means are the same value. It turns out that we can test this same hypothesis by ex- cluding any one of the dummies, and including the remaining five in the regression. The co- efficients will differ, but the p− value of the ANOVA F will be identical for any of these regressions. In fact, this regression is an ex- ample of “classical one-way ANOVA”–testing whether a qualitative factor (in this case, state of residence) explains a significant fraction of the variation in income.
What if we wanted to generate point and in- terval estimates of the state means of income? Then it would be most convenient to refor- mulate (??) by including all 6 dummies, and removing the constant term. This is, alge- braically, the same regression. The coefficient on the now-included st 6 will be precisely that reported above as β 0. The coefficient reported for st 1 will be precisely (β 0 + β 1 ) from the pre- vious model, and so on. But now those co- efficients will be reported with confidence in- tervals around the state means. Those statis- tics could all be calculated if you only esti- mated (??), but to do so you would have to use lincom for each coefficient. Running this alternative form of the model is much more convenient for estimating the state means in point and interval form. But to test the hy- pothesis (??), it is most convenient to run the original regression–since then the ANOVA F performs the appropriate test with no further ado.
above. Let’s say that Vermont, New Hamp- shire and Maine have been coded as st6, st and st3, respectively. We may just gen nen = st3+st4+st6, since the sum of mutually exclu- sive and exhaustive dummies must be another dummy. To check, the resulting nen will have a mean equal to the percentage of the sample that live in northern New England; the equiva- lent nes dummy will have a mean for southern New England residents; and the sum of those two means will of course be 1. We can then run a simplified form of our model as regress inc nen; the ANOVA F statistic for that regres- sion tests the null hypothesis that incomes in northern and southern New England do not differ significantly. Since we have excluded nes, the “slope” coefficient on nen measures the amount by which northern New England income differs from southern New England in- come; the mean income for southern New Eng- land is the constant term. If we want point and
interval estimates for those means, we should regress inc nen nes, noc.
Regression with continuous and dummy vari- ables
In the above examples, we have estimated “pure ANOVA” models–regression models in which all of the explanatory variables are dummies. In econometric research, we often want to com- bine quantitative and qualitative information, including some regressors that are measurable and others that are dummies. Consder the simplest example: we have data on individu- als’ wages, years of education, and their gen- der. We could create two gender dummies, male and female, but we will only need one in the analysis: say, female. We create this vari- able as gen female = (gender==’’F’’). We can then estimate the model:
wage = β 0 + β 1 educ + β 2 f emale + u (3)
classified as race=white or race=black. Then we could gen black = (race==‘‘black’’) to cre- ate the dummy variable, and add it to (??). What, now, is the constant term? The wage for a white male with zero years of education. Is there a significant race differential in wages? If so, the coefficient b 3 , which measures the difference between white and black wages, ce- teris paribus, will be significantly different from zero. In {educ, wage} space, the model can be represented as four parallel lines, with each in- tercept labelled by a combination of gender and race.
What if our racial data classified each worker as white, Black or Asian? Then we would run the regression:
wage = β 0 +β 1 educ+β 2 f emale+β 3 Black+β 4 Asian+u (4)
where the constant term still refers to a white male. In this model, b 3 measures the differ- ence between black and white wages, ceteris paribus, while b 4 measures the difference be- tween Asian and white wages. Each can be examined for significance. But how can we determine whether the qualitative factor, race, affects wages? That is a joint test, that both β 3 = 0 and β 4 = 0, and should be conducted as such. We should not make judgments based on the individual dummies’ coefficients, but should rather include both race variables if the null is rejected, or remove them both if it is not. When we examine a qualitative factor, which may give rise to a number of dummy variables, they should be treated as a group. For instance, we might want to modify (??) to consider the effect of state of residence:
wage = β 0 + β 1 educ + β 2 f emale +
∑^5 j=
γjstj + u
(5)
dummies would, likewise, measure the percent- age difference in wage levels between that state and the excluded state (number 6).
We must be careful when working with vari- ables that have an ordinal interpretation, and are thus coded in numeric form, to treat them as ordinal. For instance, if we model the in- terest rate corporations must pay to borrow (corprt) as a function of their credit rating, we consider that Moody’s and Standard and Poor’s assign credit ratings somewhat like grades: AAA, AA, A, BAA, BA, B, C, et cetera. Those could be coded as 1,2,...,7. Just as we can agree that an “A” grade is better than a “B”, a triple-A bond rating results in a lower bor- rowing cost than a double-A rating. But while GPAs are measured on a clear four-point scale, the bond ratings are merely ordinal, or ordered: everyone agrees on the rating scale, but the differential between AA borrowers’ rates and A
borrowers’ rates might be much smaller than that between B and C borrowers’ rates: es- pecially the case if C denotes “below invest- ment grade”, which will reduce the market for such bonds. Thus, although we might have a numeric index corresponding to AAA...C, we should not assume that ∂corprt/∂index is con- stant; we should not treat index as a cardi- nal measure. Clearly, the appropriate way to proceed is to create dummy variables for each rating class, and include all but one of those variables in a regression of corprt on bond rat- ing and other relevant factors. For instance, if we leave out the AAA dummy, all of the ratings class dummies’ coefficients will then measure the degree to which those borrowers’ bonds bear higher rates than those of AAA borrowers. But we could just as well leave out the C rating class dummy, and measure the effects of rat- ings classes relative to the worst credits’ cost of borrowing.
dependent variable. Why? Because this joint distribution is modelled as the product of the marginals. What is the difference between male and female wages? b 1 , irrespective of marital status. What is the difference between un- married and married wages? b 2 , irrespective of gender.
If we were to relax the assumption that gen- der and marital status had independent effects on wages, we would want to consider their interaction. Since there are only two cate- gories of each variable, we only need one in- teraction term, f m, to capture the possible ef- fects. As above, that term could be generated as a Boolean (noting that & is Stata’s AND operator): gen fm=(female==1) & (married==1), or we could generate it algebraically, as gen fm=female*married. In either case, it represents the intersection of the sets. We then add a term, b 3 f m, to the equation, which then ap- pears as an additive constant in the lower right
cell of the table. Now, if the coefficient on f m is significantly nonzero, the effect of being fe- male on the wage differs, depending on marital status, and vice versa. Are the interaction ef- fects important–that is, does the joint distribu- tion differ from the product of the marginals? That is easily discerned, since if that is so b 3 will be significantly nonzero.
Two extensions of this framework come to mind. Sticking with two-way ANOVA (con- sidering two factors’ effects), imagine that in- stead of marital status we consider race = {white, Black, Asian}. To run the model with- out interactions, we would include two of these dummies in the regression–say, Black and Asian; the constant term would be the mean wage of a white male (the excluded class). What if we wanted to include interactions? Then we would define f Black and f Asian, and include those two regressors as well. The test for the
the two separate regressions, but if we did that, we could not conduct any tests (e.g. do males and females have the same intercept? The same slope?). If we use interacted dummies, we can run one regression, and test all of the special cases of this model which are nested within: that the slopes are the same, that the intercepts are the same, and the “pooled” case in which we need not distinguish between males and females. Since each of these special cases merely involves restrictions on this gen- eral form, we can run this equation and then just conduct the appropriate tests.
If we extended this logic to include race, as de- fined above, as an additional factor, we would include two of the race dummies (say, Black and Asian) and interact each with educ. This would be a model without interactions–where the effects of gender and race are considered
to be independent–but it would allow us to es- timate different regression lines for each com- bination of gender and race, and test for the importance of each factor. These interaction methods are often used to test hypotheses about the importance of a qualitative factor–for in- stance, in a sample of companies from which we are estimating their profitability, we may want to distinguish between companies in dif- ferent industries, or companies that underwent a significant merger, or companies that were formed within the last decade, and evaluate whether their expenditures on R&D or adver- tising have the same effects across those cat- egories.
All of the necessary tests involving dummy vari- ables and interacted dummy variables may be easily specified and computed, since models without interacted dummies (or without cer- tain dummies in any form) are merely restricted