WESS Econometrcs (Handout ) Dummy varables n multple varable regresson model. Addtve dummy varables In the prevous handout we consdered the followng regresson model: y x 2x2 k xk,, 2,, n and we nterpreted the coeffcents by partally dfferentatng the dependent varable wth respect to each explanatory varable y x Change n y Unt ncrease n x Holdng all else constant However, n many cases we do not have actual data for many varables that we want to nclude nto a regresson model. For example, n an equaton for wage we may want to allow for the possblty that females appeared to be pad less money for the same job. In whch case we may want to specfy a model: ln( w ) School Female () 2 where, School = Number of years of schoolng, and Female f female, 0 f male. The varable Female s known as an addtve dummy varable and has the effect of vertcally shftng the regresson lne. In all models wth dummy varables the best way to proceed s wrte out the model for each of the categores to whch the dummy varable relates. So n our case the categorcal varable would be gender (whch has two categores Males and Females). For Males (when Females=0), we have from (): ln( w ) School (2a) Whereas for females (when Females=), we have from () ln( w ) School that s, 2 ln( w ) ( ) School (2b) 2 and so the ntercept s n equaton (2a) and s ( 2) n equaton (2b). So the two lnes are parallel (as they have the same slope coeffcents), but they cross the vertcal axs at dfferent ponts. If we take expected values of equaton (2a) we get: E ln( w M ) School and takng expected values of equaton (2b) we get F E ln( w) ( 2) School Now the dfference between these two expressons for the same value of School s:
WESS Econometrcs (Handout ) ln( ) F M E w E ln( w) 2 so 2 s of the change n the expected value of ln(w) for a female compared to a male for a gven value of School. Pctorally ths s shown n Fgure, where the dashed lne represents the regresson lne for males and the sold lne that for females. Fgure : The role of an addtve dummy varable.6.5. ln(w).3 b 3.2. 3.9 2 3 5 6 7 8 School If nstead of estmatng equaton (), we estmated ln( w ) School Male (3) 0 2 where Male f male, 0 f female, as Male Female then ln( w ) School ( Female ) 0 2 ln( w ) School Female 0 2 2 ln( w ) ( ) School Female () 0 2 2 Comparng equaton () wth equaton () as the varables on the left and rght hand sde of the equaton are dentcal the coeffcents must be dentcal, n whch case:,, 2 2 0 2 and so by usng Male n place of Female n equaton (), all that happens s the coeffcent on the Male dummy wll be mnus that on the Female dummy and the coeffcent on the ntercept wll shft accordngly to allow for the fact that a Female s now the default case. For the categorcal varable gender (n whch there are two categores), you nclude dummy varable n the regresson model (n our example Female), so that Male s the 2
WESS Econometrcs (Handout ) default and the coeffcent on Female s the change n the expected value of the dependent varable (for gven values of the other varables) for females relatve to males. In general, f there s a categorcal varable wth s categores, then you nclude s- dummy varables and the omtted category s the default and the coeffcent on any ncluded category s then measured relatve to the default (omtted) category. 2. Multplcatve dummy varables In the equaton for wage we may also want to allow for the possblty that female pay, relatve to male pay, vares wth the level of schoolng. In whch case we may want to specfy a model: ln( w ) School Female ( Female School ) (5) 2 3 where School = Number of years of schoolng and Female f person s female, 0 f male. The varable Female s known as an addtve dummy varable and ( Female School ) s known as a multplcatve dummy varable. The multplcatve dummy varable has the effect of rotatng the regresson lne, so for Males (when Females=0) and we have from (5): ln( w ) School (6) Whereas for females (when Females=) and we have from (5) ln( w ) School School that s, 2 3 ln( w ) ( ) ( ) School (7) 2 3 and so the ntercept s and the coeffcent on School s n equaton (6) and the ntercept s ( 2) and the coeffcent on School s ( 3) n equaton (7). So 2 s the change n the expected value of ln(w) for a female compared to a male for School=0, whle, ln( w ) School ln( w ) School All else constant and Male ( ) 3 All else constant and Female and 3 s the ncrease n the sem-elastcty of wages wth respect to an extra year of schoolng for females compared to males. Pctorally ths s shown n Fgure 2, where 3
WESS Econometrcs (Handout ) the dashed lne represents the regresson lne for males and the sold lne that for females. Fgure 2: The role of an multplcatve dummy varable.6.5. b.3 ln(w) b +b 3.2. 3.9 2 3 5 6 7 8 School As gender has two categores, you can only nclude multplcatve dummy varable n our regresson model ( Female School ), so that Male s the default and the coeffcent on Female School s the change n the coeffcent on School (for gven values of the other varables) for females compared to males. In general, f there s a categorcal varable wth s categores, then you nclude s- multplcatve dummy varables (multpled by School) and the omtted category s the default and the coeffcent on any of the multplcatve dummy varables s measured relatve to the default (omtted) category. 3. Interactve dummy varables In the equaton for wage we may also want to allow for the possblty that two dummy varables could be multpled together, for example, to allow n the model females to be pad less than males and that the dfferental be dfferent for non-whtes (non-wh). In whch case we may want to specfy a model: ln( w ) Female non wh ( Female non wh ) (8) 2 3 In whch we have alternatve cases. Male-whte ln( w ).0.0.0.0 2 3
WESS Econometrcs (Handout ) E[ln( w )] 2. Female-whte ln( w )..0..0 E[ln( w )] 3. Male-Non-whte 2 3 ln( w ).0..0. E[ln( w )] 2 2 3. Female-Non-whte ln( w ).... 2 3 (9a) (9b) (9c) E[ln( w )] 2 3 (9d) Comparng equaton (9b) to equaton (9a): E w E w F, Wh M, Wh ln( ) ln( ) (0a) that s, = Proportonate change n expected wages for females compared to males, gven they are a whte ndvdual. Comparng equaton (9c) to equaton (9a): E w E w M, NonWh M, Wh ln( ) ln( ) 2 (0b) That s, 3 = Proportonate change n expected wages for Whte ndvduals compared to Non-whte ndvduals gven they are males. Comparng equaton (9d) to equaton (9c): E w E w F, NonWh M, NonWh ln( ) ln( ) ( 3) (0c) that s, 2 = Proportonate change n expected wages for females compared to males, gven they are a non-whte ndvdual Comparng equaton (0c) to equaton (0a) ln( ) F, Non Wh ln( ) M, Non Wh ln( ) F, Wh ln( ) M, Wh E w E w E w E w 3 (0d) That s, = Addtonal proportonate change n expected wages for females (compared to males) who are a non-whte ndvdual compared to a whte ndvdual. 5
WESS Econometrcs (Handout ) Alternatvely we could wrte ths as: Male Female Gender effect Whte 2 Non-whte 2 2 3 3 3 Ethncty effect 2 2 3 3 Ths s an example of a dfference-n-dfference model as the coeffcent on the nteracton term s nterpreted as the dfference between two dfferences (see equaton (0d)). Suppose we know that average salares lsted below: Male Female Gender effect Whte 5.09 2.58-2.5 Non-whte.92 2.50-2.2 0.09 Ethncty effect -0.7-0.08 0.09 Then usng these numbers and estmatng equaton (8) by OLS would yeld: a 5.09, b 2.5, b2 0.7 and b 3 0.09. 6