$…$ / $$…$$), leggibile e copiabile con lo screen reader. Scorciatoia: Alt+Shift+L.
The dummy variables (sometimes referred to as binary variables) are variables which can only be equal to \(0\) or to \(1\). They are typically employed when a certain effect or situation occurs under some circumstances or in some periods but not in other ones. They can be either summed in a regression equation or multiplied by the explanatory variables, depending on the context at hand.
We have already encountered a dummy variable (i.e., kids) in the previous Example 7, where the dummy intended to highlight the effect of possible presence of children in the involved female population.
On the other hand, the following worked example is borrowed from basic Microeconomics, and it can be useful for comprehension.
Example 9.
Suppose that we are constructing the regression line to estimate the quantity of ice creams consumed by the population in the \(4\) seasons. We consider the following variables:- \(Q\): demanded quantity of ice creams;
- \(P\): price of ice creams;
- \(E\): total expenditure of consumers.
We can construct the linear relations with the help of a dummy variable in \(2\) ways: either additive or multiplicative.
In the additive case, the linear relation to be analyzed is: \begin {equation} Q=\beta _1 + \alpha _1 D + \beta _2 E + \beta _3 P + \epsilon , \label {additivedummyexample} \end {equation} where the regression parameters are \(\beta _1, \beta _2, \beta _3\), as usual. More than that, we have a further dummy variable \(D\), which is equal to \(1\) during summertime, when ice creams are typically sold, and equal to \(0\) in the remaining \(3\) seasons. The dummy variable \(D\) is multiplied by a further regression parameter which is indicated by \(\alpha _1\) to highlight its difference with respect to the other ones. Finally, \(\epsilon \) is the usual disturbance. Passing to the expected values, we have \(2\) possible regression equations: \begin {equation*} \mathbb {E}[Q]= \ \begin {cases} \beta _1+\alpha _1+\beta _2 E + \beta _3 P \qquad \qquad \text {during the summer} \\ \beta _1+\beta _2 E + \beta _3 P \qquad \qquad \qquad \text {in the remaining seasons} \end {cases}. \end {equation*} Clearly, the estimation of \(\alpha _1\) can be carried out only in the first case.
A dummy variable can also be used as a multiplicative variable, by modifying the linear equation (1) as follows, for example: \begin {equation} Q=\beta _1 + \beta _2 E + \alpha _1 E D + \beta _3 P + \epsilon . \label {multiplicativedummyexample} \end {equation} In this case, in the period in which \(D=1\), its effect is not separated from the other variables, because it ’reinforces’ the expenditure variable \(E\). When \(D=0\), the equation coincides with the one in the additive dummy case. The \(2\) regression equations read as \begin {equation*} \mathbb {E}[Q]= \ \begin {cases} \beta _1+(\beta _2 + \alpha _1) E + \beta _3 P \qquad \qquad \text {during the summer} \\ \beta _1+\beta _2 E + \beta _3 P \qquad \qquad \qquad \text {in the remaining seasons} \end {cases}. \end {equation*}
Further advanced details go beyond the scope of the present lecture notes. As usual, for further explanation and technical details, I encourage students to read [1], Chapter \(6\).
