Dummy Variables
Pietro Balestra
From The New Palgrave Dictionary of Economics, Second Edition, 2008
Edited by Steven N. Durlauf and Lawrence E. Blume
Abstract
The dummy-variable method is a useful device for introducing, into a regression analysis, information
contained in qualitative or categorical variables, that is, in variables that are not conventionally
measured on a numerical scale, such as race, sex, marital status, occupation, or level of education. It is
a means for considering a specific scheme of parameter variation, in which the variability of the
coefficients is linked to the causal effect of some precisely identified qualitative variable. But when the
qualitative effects are generic, as in the cross-section time-series model, an interpretation in terms of
random effects may seem more appealing.
Article
In economics, as well as in other disciplines, qualitative factors often play an important role. For
instance, the achievement of a student in school may be determined, among other factors, by his
father's profession, which is a qualitative variable having as many attributes (characteristics) as there
are professions. In medicine, to take another example, the response of a patient to a drug may be
influenced by the patient's sex and the patient's smoking habits, which may be represented by two
qualitative variables, each one having two attributes. The dummy-variable method is a simple and
useful device for introducing, into a regression analysis, information contained in qualitative or
categorical variables; that is, in variables that are not conventionally measured on a numerical scale.
Such qualitative variables may include race, sex, marital status, occupation, level of education, region,
seasonal effects, and so on. In some applications, the dummy-variable procedure may also be fruitfully
applied to a quantitative variable such as age, the influence of which is frequently U-shaped. A system
of dummy variables defined by age classes conforms to any curvature and consequently may lead to
more significant results.
The working of the dummy-variable method is best illustrated by an example. Suppose we wish to fit
an Engel curve for travel expenditure, based on a sample of n individuals. For each individual i, we
have quantitative information on his travel expenditures (yi) and on his disposable income (xi), both
variables being expressed in logarithms. A natural specification of the Engel curve is:
where a and b are unknown regression parameters and ui is a non-observable random term. Under the
usual classical assumptions (which we shall adopt throughout this presentation), ordinary least-squares
produce the best estimates for a and b.
Suppose now that we have additional information concerning the education level of each individual in
the sample (presence or absence of college education). If we believe that the education level affects the
travel habits of individuals, we should explicitly account for such an effect in the regression equation.
Here, the education level is a qualitative variable with two attributes: college education; no college
education. To each attribute, we can associate a dummy variable which takes the following form:
Inserting these two dummy variables in the Engel curve, we obtain the following expanded regression:
Specification I:
which may be estimated by ordinary least-squares. Alternatively, noting that
can write:
for all i, we
Specification II:
which, again, may be estimated by ordinary least-squares.
It is easy to see how the procedure can be extended to take care of a finer classification of education
levels. Suppose, for instance, that we actually have s education levels (s attributes). All we require is
that the attributes be exhaustive and mutually exclusive. We then have the two following equivalent
specifications:
Specification I:
Specification II:
Obviously, the two specifications produce the same results but give rise to different inpts. Specification
I includes all the s dummy variables but no constant term. In this case, the coefficient of dji gives the
dummy variables and an overall constant
specific effect of attribute j. Specification II includes
term. The constant term represents the specific effect of the omitted attribute, and the coefficients of the
different dji represent the contrast (difference) of the effect of the jth attribute with respect to the effect
of the omitted attribute. (Note that it is not possible to include all dummy variables plus an overall
constant term, because of perfect collinearity.)
It is important to stress that by the introduction of additive dummy variables, it is implicitly assumed
that the qualitative variable affects only the intercept but not the slope of the regression equation. In our
example, the elasticity parameter, b, is the same for all individuals; only the intercepts differ from
individual to individual depending on their education level. If we are interested in individual variation
in slope, we can apply the same technique, as long as at least one explanatory variable has a constant
coefficient over all individuals. Take the initial case of only two attributes. If the elasticity parameter
varies according to the level of education, we have the following specification:
Simple algebra shows that ordinary least-squares estimation of this model amounts to performing two
separate regressions, one for each class of individuals. If, however, the model contained an additional
explanatory variable, say zi, with constant coefficient c, by simply adding the term czi to the above
equation, we would simultaneously allow for variation in the intercept and variation in the slope (for x).
The dummy variable model also provides a conceptual framework for testing the significance of the
qualitative variable in an easy way. Suppose we wish to test the hypothesis of no influence of the level
of education on travel expenditures. The hypothesis is true if the s coefficients ai are all equal; that is, if
the
differences
,
, are all zero. The test therefore boils down to a simple test
of significance of the
coefficients of the dummy variables in Specification II. If
, the t-test
, we may conveniently compute the
applied to the single coefficient of d1i is appropriate. If
following quantity:
which is distributed as an F-variable with
and
degrees of freedom. In the above
expression, SS is the sum of squared residuals for the model with the dummy variables (either
Specification I or II), and SSc is the sum of squared residuals for the model with no dummy variables
but with an overall constant term.
In some economic applications the main parameter of interest is the slope parameter, the coefficients of
the dummy variables being nuisance parameters. When, as in the present context, only one qualitative
variable (with s attributes) appears in the regression equation, an easy computational device is available
which eliminates the problem of estimating the coefficients of the dummy variables. To this end, it
suffices to estimate, by ordinary least-squares, the simple regression equation:
Specification III:
where the quantitative variables (both explained and explanatory) for each individual are expressed as
deviations from the mean over all individuals possessing the same attribute. For the dichotomous case
presented in the beginning, for an individual with college education, we subtract the mean over all
individuals with college education and likewise for an individual with no college education. Note,
however, that the true number of degrees of freedom is not
but
. The same procedure
also applies when the model contains other quantitative explanatory variables. The interested reader
may consult Balestra (1982) for the conditions under which this simple transformation is valid in the
context of generalized regression.
The case of multiple qualitative variables (of the explanatory type) can be handled in a similar fashion.
However, some precaution must be taken to avoid perfect collinearity of the dummy variables. The
easiest and most informative way to do this is to include, in the regression equation, an overall constant
term and to add for each qualitative variable as many dummy variables as there are attributes minus
one. Take the case of our Engel curve and suppose that, in addition to the education level (only two
levels for simplicity), the place of residence also plays a role. Let us distinguish two types of place of
residence: urban and rural. Again, we associate to these two attributes two dummy variables, say e1i
and e2i. A correct specification of the model which allows for both qualitative effects is:
Given the individual's characteristics, the measure of the qualitative effects is straightforward, as shown
in the following table:
Urban
Rural
College education
No college education
a1
The specification given above for the multiple qualitative variable model corresponds to Specification
II of the single qualitative variable model. Unfortunately, when there are two or more qualitative
variables there is no easy transformation analogous to the one incorporated in Specification III, except
under certain extraordinary circumstances (Balestra, 1982).
One such circumstance arises in connection with cross-section time-series models. Suppose that we
have n individuals observed over t periods of time. If we believe in the presence of both an individual
effect and a time effect, we may add to our model two sets of dummy variables, one corresponding to
the individual effects and the other corresponding to the time effects. This is the so-called covariance
model. The number of parameters to be estimated is possibly quite large when n or t or both are big. To
avoid this, we may estimate a transformed model (with no dummies and no constant term) in which
each quantitative variable (both explained and explanatory) for individual i and time period j is
transformed by subtracting from it both the mean of the ith individual and the mean of the jth time
period and by adding to it the overall mean. Note that, by this transformation, we lose
degrees
of freedom.
To conclude, the purpose of the preceding expository presentation has been to show that the dummyvariable method is a powerful and, at the same time, simple tool for the introduction of qualitative
effects in regression analysis. It has found and will undoubtedly find numerous applications in
empirical economic research. Broadly speaking, it may be viewed as a means for considering a specific
scheme of parameter variation, in which the variability of the coefficients is linked to the causal effect
of some precisely identified qualitative variable. But it is not, by any means, the only scheme available.
For instance, when the qualitative effects are generic, as in the cross-section time-series model, one
may question the validity of representing such effects by fixed parameters. An interpretation in terms of
random effects may seem more appealing. This type of consideration has led to the development of
other schemes of parameter variation such as the error component model and the random coefficient
model.
A final remark is in order. In the present discussion, qualitative variables of the explanatory type only
have been considered. When the qualitative variable is the explained (or dependent) variable, the
problem of these limited dependent variables is far more complex, both conceptually and
computationally.
Bibliography
Balestra, P. 1982. Dummy variables in regression analysis. In Advances in Economic Theory, ed.
Mauro Baranzini. Oxford: Blackwell.
Goldberger, A.S. 1960. Econometric Theory, pp. 218–27. New York: John Wiley.
Maddala, G.S. 1977. Econometrics, ch. 9. New York: McGraw-Hill.
Suits, D.B. 1957. Use of dummy variables in regression equations. Journal of the American Statistical
Association 52, 548–51.