ECONOMICS 5* -- Introducton to Dummy Varable Regressors ECON 5* -- Introducton to NOTE Introducton to Dummy Varable Regressors. An Example of Dummy Varable Regressors A model of North Amercan car prces gven by the PRE prce + β + β + β mpg + β frn + β frn + β frn + () where 5 6 7 u prce = the prce of the -th car (n US dollars); = the weght of the -th car (n pounds); mpg = the fuel effcency of the -th car (n mles per gallon); frn = f the -th car s foregn, = 0 f the -th car s domestc; N = 7 = the number of observatons n the estmaton sample. The regressor frn s a bnary varable called an ndcator or dummy varable. By defnton, the bnary varable frn takes only two values: frn = f the -th car s a foregn car, meanng t s manufactured outsde North Amerca; frn = 0 f the -th car s a domestc car, meanng t s manufactured nsde North Amerca. Because by defnton frn = for foregn cars, t s called a foregn-car ndcator or dummy varable. The key to nterpretng regresson equaton () s to recognze that t n fact ncludes two dstnct regresson models for car prces -- one for domestc cars, the other for foregn cars. Fle: ntronote.doc Page of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors The regresson equaton for domestc cars Set dummy varable frn = 0 n equaton (): prce + β + β + β mpg + β frn + β frn + β frn + () 5 6 7 u prce + β + β + βmpg + β5frn + β6frn + β7frn + u + β + β + βmpg + β50 + β6(0) + β7(0) + u u + β + β + β mpg + (d) The regresson equaton for foregn cars Set dummy varable frn = n equaton (): prce + β + β + β mpg + β frn + β frn + β frn + () 5 6 7 u prce + β + β + βmpg + β5frn + β6frn + β7frn + u + β + β + βmpg + β5+ β6() + β7 () + u + β + β + βmpg + β5 + β6 + β7 + u = ( β + β ) + ( β + β ) + ( β + β ) + β mpg + (f) 5 6 7 u Note that n the foregn-car prce equaton (f), foregn-car ntercept coeffcent + β 5 foregn-car slope coeffcent on + β 6 foregn-car slope coeffcent on -squared + β 7 Fle: ntronote.doc Page of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Compare foregn-car equaton (f) wth domestc-car equaton (d): prce + β + β + β mpg + (d) u prce = ( β + β ) + ( β + β ) + ( β + β ) + β mpg + (f) 5 6 7 u Queston: How are the regresson coeffcents β 5, β 6 and β 7 n regresson () nterpreted? prce + β + β + β mpg + β frn + β frn + β frn + () 5 6 7 u Answer: By nspecton and comparson of the domestc-car equaton (d) and the foregn-car equaton (f), we see that β 5 = foregn ntercept (β + β 5 ) domestc ntercept (β ) β 6 = foregn coeffcent of (β + β 6 ) domestc coeffcent of (β) β 7 = foregn coeffcent of (β + β 7 ) domestc coeffcent of (β). How Dummy Varable Regressors Enter Regresson Models Indcator (dummy) varables enter as regressors n lnear regresson models n one of two basc ways.. As Addtve Regressors: Dfferences n Intercepts When ndcator (dummy) varables are ntroduced addtvely as addtonal regressors n lnear regresson models, they allow for dfferent ntercept coeffcents across dentfable subsets of observatons n the populaton.. As Multplcatve Regressors: Dummy Varable Interacton Terms When ndcator (dummy) varables are ntroduced multplcatvely as addtonal regressors n lnear regresson models, they enter as dummy varable nteracton terms -- that s, as the product of a dummy varable wth some other regressor (ether a contnuous varable or another dummy varable). They allow for dfferent slope coeffcents across dentfable subsets of observatons n the populaton. Fle: ntronote.doc Page of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors. Four Dfferent Models of North Amercan Car Prces To llustrate the use of ndcator (dummy) varables as regressors n lnear regresson models, consder the followng four lnear regresson models for North Amercan car prces. Model : Contans no dummy varable regressors. Allows for no coeffcent dfferences between foregn and domestc cars. prce + β + β + β mpg + () u Model : Allows for dfferent foregn-car and domestc-car ntercepts by ntroducng the foregn-car ndcator varable frn as an addtonal addtve regressor n Model. prce + β + β + β mpg + δ frn + () u Model : Allows for () dfferent foregn-car and domestc-car ntercepts and () dfferent foregn-car and domestc-car slope coeffcents on the regressors and. Introduces the foregn-car nteracton terms frn and frn as addtonal multplcatve regressors n Model. prce + β + β + β mpg + δ frn + δ frn + δ frn + () u Model : Allows all regresson coeffcents -- both ntercept and slope coeffcents -- to dffer between foregn and domestc cars. It allows for () dfferent foregn-car and domestc-car ntercepts and () dfferent foregn-car and domestc-car slope coeffcents on all three regressors n Model, namely,, and mpg. Introduces the foregn-car nteracton term frn mpg as an addtonal multplcatve regressor n Model. prce + β + β + βmpg + δ frn + δ frn + δ frn + δ frn mpg + u () Fle: ntronote.doc Page of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Model. Interpretng Model : A Full-Interacton Regresson Model prce + β + β + βmpg + δ frn + δ frn + δ frn + δ frn mpg + u () The populaton regresson functon for Model s obtaned by takng the condtonal expectaton of regresson equaton () for any gven values of the three explanatory varables, mpg and frn : E( prce, mpg, frn ) + β + δ frn + β + δ frn + β mpg + δ frn (.) + δ frn mpg The domestc-car regresson equaton and domestc-car regresson functon are obtaned by settng the foregn-car ndcator varable frn = 0 n () and (.): prce + β + β + β mpg + (d) u E( prce, mpg, frn = 0) + β + β + β mpg (.) The domestc-car regresson coeffcents are β for all =,, : domestc-car ntercept coeffcent domestc-car slope coeffcent of domestc-car slope coeffcent of domestc-car slope coeffcent of mpg Fle: ntronote.doc Page 5 of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors prce + β + β + βmpg + δ frn + δ frn + δ frn + δ frn mpg + u () E( prce, mpg, frn ) + β + δ frn + β + δ frn + β mpg + δ frn (.) + δ frn mpg The foregn-car regresson equaton and foregn-car regresson functon are obtaned by settng the foregn-car ndcator varable frn = n () and (.): + + δ + δ + δ + δmpg + u prce β + β + βmpg = ( β + δ) + ( β + δ) + ( β + δ) + ( β + δ)mpg + u u = α + α + α + α mpg + (f) E( prce, mpg, frn = ) + β + β + βmpg + δ + δ + δ + δmpg + δ) + ( β + δ) + ( β + δ) + ( β + ) mpg = ( β δ + α + α + αmpg = α (.) The foregn-car regresson coeffcents are α + δ for all =,, : foregn-car ntercept coeffcent = α + δ foregn-car slope coeffcent of = α + δ foregn-car slope coeffcent of foregn-car slope coeffcent of = α + δ mpg = α + δ Solvng the equatons α + δ for δ yelds the result δ = α β for =,,. Ths gves us the nterpretaton of the δ coeffcents n Model. Fle: ntronote.doc Page 6 of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Interpretaton of the regresson coeffcents δ ( =,, ) n Model prce + β + β + βmpg + δ frn + δ frn + δ frn + δ frn mpg + u () E( prce, mpg, frn ) + β + δ frn + β + δ frn + β mpg + δ frn (.) + δ frn mpg Each of the δ coeffcents n Model equals a foregn-car regresson coeffcent mnus the correspondng domestc-car regresson coeffcent: δ = α β for all. δ = α β = foregn ntercept coeffcent domestc ntercept coeffcent δ = α β = foregn slope coeffcent of domestc slope coeffcent of δ = α β = foregn slope coeffcent of domestc slope coeffcent of δ = α β = foregn slope coeffcent of mpg domestc slope coeffcent of mpg Fle: ntronote.doc Page 7 of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors The dfference between the foregn-car regresson functon and the domestc-car regresson functon s the foregn-domestc car dfference n mean car prces for gven equal values of the explanatory varables and mpg. E( prce, mpg, frn = ) + β + β + βmpg + δ + δ + δ + δmpg (.) E( prce, mpg, frn = 0) + β + β + β mpg (.) Subtract equaton (.) for domestc cars from equaton (.) for foregn cars: E(prce, mpg, frn = ) E(prce, mpg, frn 0) = = = β β δ + β + β + β mpg β β β + δ + δ + δmpg mpg + δ + δ + δ + δ mpg Result: E(prce, mpg, frn = ) E(prce, mpg, frn 0) = δ + δ + δ + δmpg Interpretaton: = The foregn-domestc dfference n the condtonal mean value of car prce for gven values and mpg of the explanatory varables and mpg s a functon of and mpg. It s not a constant, but nstead depends on the values of the explanatory varables and mpg. The condtonal foregn-domestc mean car prce dfference addresses the followng queston: What s the foregn-domestc dfference n mean car prce for dentcal (equal) values of the explanatory varables and mpg? What s the mean prce dfference between foregn and domestc cars of the same sze () and fuel effcency (mpg)? Fle: ntronote.doc Page 8 of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors 5. An Alternatve Estmatng Equaton for Model The regresson equaton for Model can be wrtten n an alternatve but equvalent way. Defne a Domestc Car Indcator Varable Defne an ndcator or dummy varable for domestc cars named dom : dom = f the -th car s a domestc car, meanng t s manufactured nsde North Amerca; dom = 0 f the -th car s a foregn car, meanng t s manufactured outsde North Amerca. By defnton, the domestc car ndcator varable dom s related to the foregn car ndcator varable frn as follows: dom = frn for all dom + frn = so that frn = dom for all For domestc cars: frn = 0 and dom = For foregn cars: frn = and dom = 0 One Estmatng Equaton for Model The estmatng equaton for Model we have used so far ncludes a full set of nteracton terms n the foregn car ndcator varable frn : prce + β + β + βmpg + δ frn + δ frn + δ frn + δ frn mpg + u (A) The car type whose dummy varable s excluded from equaton (A) s domestc cars; domestc cars therefore consttute the base group for car type n equaton (A). Fle: ntronote.doc Page 9 of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Dervaton of a Second Estmatng Equaton for Model In equaton (A), substtute for the foregn ndcator varable frn the equvalent expresson dom ;.e., set frn = dom n equaton (A). prce + β + β + βmpg + δ frn + δ frn + δ frn + δ frn mpg + u (A). prce + β + β + β mpg + δ ( dom ) + δ ( + δ + δ + dom ) ( dom ) ( dom )mpg u. prce + β + β + βmpg + δ + δ + δ + δmpg δ dom δ δ δ + dom dom dommpg u. prce = ( β + δ) + ( β + δ) + ( β + δ) + ( β + δ) mpg δ dom δ δ δ + dom dom dommpg u In the foregn-car regresson equaton (f), we prevously defned the coeffcents β + as α ( =,,, ), the foregn-car regresson coeffcents. In the above δ regresson equaton set β + δ = α for =,,, : prce = α + α + α + αmpg Fnally, replace the δ dom δ δ δ + dom dom dommpg u δ coeffcents wth γ for =,,, : prce = α + α + α + αmpg dom + dom dom dommpg u (B) Regresson equaton (B) s a second estmatng equaton for Model ; t s observatonally equvalent to regresson equaton (A). Foregn cars consttute the base group for car type n equaton (B). Fle: ntronote.doc Page 0 of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Interpretaton of Second Estmatng Equaton (B) for Model Equaton (B) and ts mpled regresson functon are: prce = α + α + α + αmpg dom + dom dom dommpg u (B) E( prce, mpg, dom ) = α + α dom + α dom + α mpg dom dommpg (B.) The foregn-car regresson equaton and foregn-car regresson functon are obtaned by settng the domestc-car ndcator varable dom = 0 n (B) and (B.): prce = α + α + α + α mpg + (f) u E( prce, mpg, dom = 0) = α + α + α + α mpg The domestc-car regresson equaton and domestc-car regresson functon are obtaned by settng the domestc-car ndcator varable dom = n (B) and (B.): prce = α α + α + αmpg = ( α + mpg + u ) + α + α + α + ( ) ( ) ( )mpg u + β + β + β mpg + (d) u E( prce, mpg, dom = ) = α + α + α + α mpg mpg = ( α + α + α + α ) ( ) ( ) ( ) mpg + β + β + βmpg where β = α for =,,, are the domestc-car regresson coeffcents. Fle: ntronote.doc Page of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Compare Estmatng Equatons (A) and (B) for Model Equaton (A): prce + β + β + βmpg + δ frn + δ frn + δ frn + δ frn mpg + u (A) where: the domestc-car regresson coeffcents are β ( =,,, ) the foregn-car regresson coeffcents are α + δ ( =,,, ) mpled expressons for β are: β = α δ ( =,,, ) Equaton (B): prce = α + α + α + αmpg dom + dom dom dommpg u (B) where: the domestc-car regresson coeffcents are β = α ( =,,, ) the foregn-car regresson coeffcents are α ( =,,, ) mpled expressons for α are: α γ ( =,,, ) Compare expressons for foregn-car coeffcents α from equatons (A) and (B): α + δ n (A) and α γ n (B) mples that δ = γ Compare expressons for domestc-car coeffcents β from equatons (A) and (B): β = α δ n (A) and = α β n (B) mples that γ = δ Fle: ntronote.doc Page of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Results: Equatons (A) and (B) are observatonally equvalent regresson equatons. prce + β + β + βmpg + δ frn + δ frn + δ frn + δ frn mpg + u (A) prce = α + α + α + αmpg dom + dom dom dommpg u (B). The δ coeffcents n (A) and the γ coeffcents n (B) are equal n magntude but opposte n sgn. δ coeffcents = foregn-domestc coeffcent dfferences = α β γ coeffcents = domestc-foregn coeffcent dfferences α. Equatons (A) and (B) yeld dentcal estmates of the foregn-car coeffcents α and the domestc-car coeffcents β.. OLS estmaton of equatons (A) and (B) yelds dentcal values of: RSS = the resdual sum-of-squares ESS = the explaned sum-of-squares R = the ordnary R-squared R = the adusted R-squared ˆσ = the estmator of the error varance ANOVA F 0 = the ANOVA F-statstc σ Fle: ntronote.doc Page of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Example: OLS estmates of Equatons (A) and (B). * Equaton (A). regress prce sq mpg frn frn frnsq frnmpg Source SS df MS Number of obs = 7 -------------+------------------------------ F( 7, 66) = 8.65 Model 8657 7 60595. Prob > F = 0.0000 Resdual 99 66 09.07 R-squared = 0.66 -------------+------------------------------ Ad R-squared = 0.686 Total 6506596 7 869955.97 Root MSE = 797.5 prce Coef. Std. Err. t P> t [95% Conf. Interval] -8.80.076 -.9 0.005 -.8508 -.7759 sq.00898.0000.5 0.000.00059.0077 mpg 78.075 5.57 0.68 0.50-5.60 08.75 frn -7.55 70.79-0.7 0.867-87. 6878.7 frn.557 0.767 0. 0.85-8.75.6665 frnsq.0005.00960 0. 0.89 -.0088.0088 frnmpg -00.58.79-0.7 0.8-8. 8.887 _cons 97.05 797.98.66 0.0-98. 6.. * Equaton (B). regress prce sq mpg dom dom domsq dommpg Source SS df MS Number of obs = 7 -------------+------------------------------ F( 7, 66) = 8.65 Model 8657 7 60595. Prob > F = 0.0000 Resdual 99 66 09.07 R-squared = 0.66 -------------+------------------------------ Ad R-squared = 0.686 Total 6506596 7 869955.97 Root MSE = 797.5 prce Coef. Std. Err. t P> t [95% Conf. Interval] -6.66887 9.878-0.68 0.500-6.78.9 sq.005.0095. 0.9 -.0099.00659 mpg -.077 8.59-0.7 0.787-8.7 0.55 dom 7.55 70.79 0.7 0.867-6878.7 87. dom -.557 0.767-0. 0.85 -.6665 8.75 domsq -.0005.00960-0. 0.89 -.0088.0088 dommpg 00.58.79 0.7 0.8-8.887 8. _cons 997.699 89.6 0.7 0.6-6097.8 509.58 Fle: ntronote.doc Page of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Computng foregn-car coeffcent estmates from Equaton (A). * Followng Equaton (A). lncom _b[_cons] + _b[frn] ( ) frn + _cons = 0.0 prce Coef. Std. Err. t P> t [95% Conf. Interval] () 997.699 89.6 0.7 0.6-6097.8 509.58. lncom _b[] + _b[frn] ( ) + frn = 0.0 prce Coef. Std. Err. t P> t [95% Conf. Interval] () -6.66887 9.878-0.68 0.500-6.78.9. lncom _b[sq] + _b[frnsq] ( ) sq + frnsq = 0.0 prce Coef. Std. Err. t P> t [95% Conf. Interval] ().005.0095. 0.9 -.0099.00659. lncom _b[mpg] + _b[frnmpg] ( ) mpg + frnmpg = 0.0 prce Coef. Std. Err. t P> t [95% Conf. Interval] () -.077 8.59-0.7 0.787-8.7 0.55. * Equaton (B). regress prce sq mpg dom dom domsq dommpg prce Coef. Std. Err. t P> t [95% Conf. Interval] -6.66887 9.878-0.68 0.500-6.78.9 sq.005.0095. 0.9 -.0099.00659 mpg -.077 8.59-0.7 0.787-8.7 0.55 dom 7.55 70.79 0.7 0.867-6878.7 87. Fle: ntronote.doc Page 5 of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors output omtted Fle: ntronote.doc Page 6 of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors Computng domestc-car coeffcent estmates from Equaton (B). * Followng Equaton (B). lncom _b[_cons] + _b[dom] ( ) dom + _cons = 0.0 prce Coef. Std. Err. t P> t [95% Conf. Interval] () 97.05 797.98.66 0.0-98. 6.. lncom _b[] + _b[dom] ( ) + dom = 0.0 prce Coef. Std. Err. t P> t [95% Conf. Interval] () -8.80.076 -.9 0.005 -.8508 -.7759. lncom _b[sq] + _b[domsq] ( ) sq + domsq = 0.0 prce Coef. Std. Err. t P> t [95% Conf. Interval] ().00898.0000.5 0.000.00059.0077. lncom _b[mpg] + _b[dommpg] ( ) mpg + dommpg = 0.0 prce Coef. Std. Err. t P> t [95% Conf. Interval] () 78.075 5.57 0.68 0.50-5.60 08.75. * Equaton (A). regress prce sq mpg frn frn frnsq frnmpg prce Coef. Std. Err. t P> t [95% Conf. Interval] -8.80.076 -.9 0.005 -.8508 -.7759 sq.00898.0000.5 0.000.00059.0077 mpg 78.075 5.57 0.68 0.50-5.60 08.75 frn -7.55 70.79-0.7 0.867-87. 6878.7 Fle: ntronote.doc Page 7 of 8 pages
ECONOMICS 5* -- Introducton to Dummy Varable Regressors output omtted Fle: ntronote.doc Page 8 of 8 pages