Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Dummy Variables. 2 Topics for This Chapter 1. Intercept Dummy Variables 2. Slope Dummy Variables 3. Different Intercepts & Slopes 4. Testing Qualitative.

Similar presentations


Presentation on theme: "1 Dummy Variables. 2 Topics for This Chapter 1. Intercept Dummy Variables 2. Slope Dummy Variables 3. Different Intercepts & Slopes 4. Testing Qualitative."— Presentation transcript:

1 1 Dummy Variables

2 2 Topics for This Chapter 1. Intercept Dummy Variables 2. Slope Dummy Variables 3. Different Intercepts & Slopes 4. Testing Qualitative Effects 5. Are Two Regressions Equal? 6. Interaction Effects

3 3 Dummy variables  Dummy variables, often called binary or dichotomous variables, are explanatory variables that only take two values, usually 0 and 1.  These simple variables are a very powerful tool for capturing qualitative characteristics of individuals, such as gender, race, geographic region of residence.  In general, we use dummy variables to describe any event that has only two possible outcomes.

4 4 Intercept Dummy Variables Dummy variables are binary (0,1) D t = 1 if red car, D t = 0 otherwise. y t =  1 +  2 X t +  3 D t + ε t y t = speed of car in miles per hour X t = age of car in years Police: red cars travel faster. H 0 :  3 = 0 H 1 :  3 > 0

5 5 y t =  1 +  2 x t +  3 D t + ε t red cars: y t = (  1 +  3 ) +  2 x t + ε t other cars: y t =  1 +  2 x t + ε t ytyt XtXt miles per hour age in years 0  1 +  3 11  2 +  3 22 red cars other cars

6 6 Slope Dummy Variables y t =  1 +  2 X t +  3 D t X t + ε t y t =  1 + (  2 +  3 )X t + ε t y t =  1 +  2 X t + ε t ytyt XtXt Value of portfolio years 0  2 +  3 11 22 stocks bonds Stock portfolio: D t = 1 Bond portfolio: D t = 0  1 = initial investment

7 7 Different Intercepts & Slopes y t =  1 +  2 X t +  3 D t +  4 D t X t + ε t y t = (  1 +  3 ) + (  2 +  4 )X t + ε t y t =  1 +  2 X t + ε t ytyt XtXt harvest weight of corn rainfall  2 +  4 11 22 Miracle regular Miracle seed: D t = 1 regular seed: D t = 0  1 +  3

8 8 y t =  1 +  2 X t +  3 D t + ε t 22  1 +  3 22 11 ytyt XtXt Men Women 0 y t =  1 +  2 X t + ε t For men  D t = 1. For women  D t = 0. years of experience y t = (  1 +  3 ) +  2 X t + ε t wage rate H 0 :  3 = 0 H 1 :  3 > 0.. Testing for discrimination in starting wage

9 9 y t =  1 +  5 X t +  6 D t X t + ε t 55  5 +  6 11 ytyt XtXt Men Women 0 y t =  1 + (  5 +  6 )X t + ε t y t =  1 +  5 X t + ε t For men D t = 1. For women D t = 0. Men and women have the same starting wage,  1, but their wage rates increase at different rates (different  6 ).  6 >  means that men’s wage rates are increasing faster than women's wage rates. years of experience wage rate

10 10 y t =  1 +  2 X t +  3 D t +  4 D t X t + ε t  1 +  3 11 22  2 +  4 ytyt XtXt Men Women 0 y t = (  1 +  3 ) + (  2 +  4 ) X t + ε t y t =  1 +  2 X t + ε t Women are given a higher starting wage,  1, while men get the lower starting wage,  1 +  3, (  3 < 0 ). But, men get a faster rate of increase in their wages,  2 +  4, which is higher than the rate of increase for women,  2, (since  4 > 0 ). years of experience An Ineffective Affirmative Action Plan women are started at a higher wage. Note: (  3 < 0 ) wage rate

11 11 Testing Qualitative Effects 1. Test for differences in intercept. 2. Test for differences in slope. 3. Test for differences in both intercept and slope.

12 12 H 0 :    vs  1 :    H 0 :    vs  1 :    YtYt  1  2 XtXt  3 DtDt  4 DtDt XtXt b   3 Est.Var bb 3 t T  4 b    4 Est.Var bb 4 t T  4 men: D t = 1 ; women: D t = 0 Testing for discrimination in starting wage. Testing for discrimination in wage increases. intercept slope  ε t  

13 13 Testing  H o :        H 1 : otherwise and SSE R   y t  b 1  b 2 X t  2 t  1 T  U  y t  b 1  b  X t  b  D t  b  D t X t  2 t  1 T   R  U  2 U  T  4   F  intercept and slope

14 14 The University Effect on House Prices  A real estate economist collects data on two similar neighborhoods, one bordering a large state university, and one that is a neighborhood about 3 miles from the university.  Records 1000 observations  Dependent Variable: House prices are given in $;  Independent Variables:  SQFT is the number of square feet of living area.  AGE are the house age (years)  UTOWN = 1 for homes near the university, 0 otherwise  USQFT = SQFT  UTOWN  POOL = 1 if a pool is present, 0 otherwise  FPLACE = 1 is a fireplace is present, 0 otherwise

15 15  We anticipate that all the coefficients in this model will be positive except, which is an estimate of the effect of age (or depreciation) on house price.  The model R-squared = 0.869 and the overall-F statistic value is F= 1104.213. Parameter Standard T for H0: Variable DF Estimate Error Parameter=0 Prob > |T| INTERCEP 1 24500 6191.721 3.957 0.0001 UTOWN 1 27453 8422.582 3.259 0.0012 SQFT 1 76.122 2.452 31.048 0.0001 USQFT 1 12.994 3.321 3.913 0.0001 AGE 1 -190.086 51.205 -3.712 0.0002 POOL 1 4377.163 1196.692 3.658 0.0003 FPLACE 1 1649.176 971.957 1.697 0.0901

16 16 Based on these regression estimates, what do we conclude?  We estimate the location premium, for lots near the university, to be $27,453  We estimate the price per square foot to be $89.11 (= $76.122 + $12.994) for houses near the university, and $76.12 for houses in other areas.  We estimate that houses depreciate $190.09 per year  We estimate that a pool increases the value of a home by $4377.16  We estimate that a fireplace increases the value of a home by $1649.17

17 17 Are Two Regressions Equal? y t =  1 +  2 X t +  3 D t +  4 D t X t + ε t I. Restricted versus Unrestricted Models men: D t = 1 ; women: D t = 0 H 0 :  3 =  4 = 0 vs. H 1 : otherwise y t = wage rateX t = years of experience Chow Test (there are two alternative ways)

18 18 y t =  1 +  2 X t + ε t II. Get SSE U separately y tm =  1 +  2 X tm + ε tm y tw =  1 +  2 X tw + ε tw Everyone: Men only: Women only: SSE R Forcing men and women to have same  1,  2. Allowing men and women to be different. SSE m SSE w where SSE U = SSE m + SSE w F = (SSE R  SSE U )/J SSE U /(T  K) J = # restrictions K=unrestricted coefs. (running three regressions) J = 2 K = 4

19 19 Interaction Variables 1. Interaction Dummies 2. Polynomial Terms (special case of continuous interaction) 3. Interaction Among Continuous Variables

20 20 Interactions Between Qualitative Factors  Suppose we are estimating a wage equation, in which an individual’s wages are explained as a function of their experience, skill, and other factors related to productivity.  It is customary to include dummy variables for race and gender in such equations.  Including just race and gender dummies will not capture interactions between these qualitative factors. Special wage treatment for being “white” and “male” is not captured by separate race and gender dummies.  To allow for such a possibility consider the following specification, where for simplicity we use only experience (EXP) as a productivity measure

21 21 Wage =  1 +  2 EXP +  1 RACE +  2 SEX +  (RACE  SEX) + ε where  1 measures the effect of race  2 measures the effect of gender  measures the effect of being “white” and “male.”

22 22 1. Interaction Dummies y t =  1 +  2 X t +  3 M t +  4 B t + ε t For men  M t = 1. For women  M t = 0. For black  B t = 1. For nonblack  B t = 0. No Interaction: wage gap assumed the same: y t =  1 +  2 X t +  3 M t +  4 B t +  5 M t B t + ε t Interaction: wage gap depends on race: Wage Gap between Men and Women y t = wage rate; X t = experience

23 23 2. Polynomial Terms y t =  1 +  2 X t +  3 X 2 t +  4 X 3 t + ε t Linear in parameters but nonlinear in variables: y t = income; X t = age Polynomial Regression ytyt X tX t People retire at different ages or not at all. 90 203040 5060 80 70

24 24 y t =  1 +  2 X t +  3 X 2 t +  4 X 3 t + ε t y t = income; X t = age Polynomial Regression Rate income is changing as we age: ytyt XtXt =  2 + 2  3 X t + 3  4 X 2 t Slope changes as X t changes.

25 25 3. Continuous Interaction y t =  1 +  2 Z t +  3 B t +  4 Z t B t + ε t Exam grade = f(sleep: Z t, study time: B t ) Sleep and study time do not act independently. More study time will be more effective when combined with more sleep and less effective when combined with less sleep.

26 26 Your mind sorts things out while you sleep (when you have things to sort out.) y t =  1 +  2 Z t +  3 B t +  4 Z t B t + ε t Exam grade = f(sleep: Z t, study time: B t ) ytyt BtBt =  2 +  4 Z t Your studying is more effective with more sleep. ytyt ZtZt =  2 +  4 B t continuous interaction

27 27 y t =  1 +  2 Z t +  3 B t +  4 Z t B t + ε t Exam grade = f(sleep: Z t, study time: B t ) If Z t + B t = 24 hours, then B t = (24  Z t ) y t =  1 +  2 Z t +  3 (24  Z t ) +  4 Z t (24  Z t ) + ε t y t = (  1 + 24  3 ) + (  2  3 + 24  4 )Z t   4 Z 2 t + ε t y t =  1 +  2 Z t +  3 Z 2 t + ε t Sleep needed to maximize your exam grade: ytyt ZtZt =  2 + 2  3 Z t = 0 where  2 > 0 and  3 < 0  2  3 Z t =

28 28 Qualitative Variables with Several Categories  Many qualitative factors have more than two categories.  Examples are region of the country (North, South, East, West) and level of educational attainment (less than high school, high school, college, postgraduate).  For each category we create a separate binary dummy variable.  To illustrate, let us again use a wage equation as an example, and focus only on experience and level of educational attainment (as a proxy for skill) as explanatory variables.

29 29 Define dummies for educational attainment as follows: Specify the wage equation as Wage =  1 +  2 EXP +  1 E 1 +  2 E 2 +  3 E 3 + ε

30 30  First notice that we have not included all the dummy variables for educational attainment. Doing so would have created a model in which exact collinearity exists.  Since the educational categories are exhaustive, the sum of the education dummies is equal to 1. Thus the “intercept variable,” is an exact linear combination of the education dummies.  The usual solution to this problem is to omit one dummy variable, which defines a reference group, as we shall see by examining the regression function,

31 31   1 measures the expected wage differential between workers who have a high school diploma and those who do not.   2 measures the expected wage differential between workers who have a college degree and those who did not graduate from high school, and so on.

32 32  The omitted dummy variable, E 0, identifies those who did not graduate from high school. The coefficients of the dummy variables represent expected wage differentials relative to this group.  The intercept parameter  1 represents the base wage for a worker with no experience and no high school diploma.  Mathematically it does NOT matter which dummy variable is omitted, although the choice of E 0 is convenient in the example above.  If we are estimating an equation using geographic dummy variables, N, S, E and W, identifying regions of the country, the choice of which dummy variable to omit is arbitrary.


Download ppt "1 Dummy Variables. 2 Topics for This Chapter 1. Intercept Dummy Variables 2. Slope Dummy Variables 3. Different Intercepts & Slopes 4. Testing Qualitative."

Similar presentations


Ads by Google