哑元变量 dummy variables
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Mean salary of female accountant:
E(Y|X, D=0) = b1 + b3X
Expect a negative coefficient on D.
E(Y|X, D=1) = b1 + b2D + b3X
Including Both Categories
We cannot put in 2 dummies (1 for male and 1 for female)
Including Both Categories
Now D1 is simply 1- D2
whenever D2 is 1, D1 is 0; whenever D2 is 0, D1 is 1. whenever D1 is 1, D2 is 0; whenever D1 is 0, D2 is 1.
Accountant Exe the results:
Y = 35.20 + 10.25D t (43.82) (9.45)
Y is income in thousands D is a dummy variable taking on the value of 1 if male.
Add Quantitative Variable
Suppose we estimate this equation
Y = 25.20 + 8.25D + 1.25X t (32.85) (10.45) (15.11) Female salary is $25,200 assuming 0 years of experience. Male salary is $33,450 assuming 0 years of experience. One year of experience adds $1,250 to salary of either male or female accountants.
Education Categories
Education has 3 categories:
H.S. dropout, high school, college
Set up the dummies as:
Dhigh= 1 if high school graduate; 0 otherwise Dcollege = 1 if college graduate; 0 otherwise Our omitted category is less than high school
The level of the male salary is higher than the female, but the increase in salary as experience increases is the same for both male and female accountants
For a high school graduate it is:
For a college graduate it is:
E(Y|Dhigh = 0, Dcollege = 1, X) = b1 + b3 + b4X
Results
Suppose get the following results:
More than 2 Categories
Suppose examine expenditures on health care as a function of income and education.
Spending=f(income, education) Income is a continuous variable Have data only whether or not graduated from high school or college--not years of schooling.
Spending by Education
The mean value of spending for a less than high school individual is:
E(Y|Dhigh = 0, Dcollege = 0, X) = b1 + b4X E(Y|Dhigh = 1, Dcollege = 0, X) = b1 + b2 + b4X
Else will have perfect collinearity.
What if estimate model with female and male dummies.
D1 which is 1 if male, 0 if female D2 which is 1 if female, 0 if male
2. Model with Dummy Variable and Quantitative Variable
Add Quantitative Variable
Then model becomes:
Y = b1 + b2D + b3X + e
Y = accountants salary D = 1 if male, otherwise 0 X = years of experience
Add Quantitative Variable
The t value on the dummy variable indicates that, holding experience constant, the mean salaries of male and female accountants are different.
Chapter 9: Dummy Variables
Zongyi ZHANG
College of Economics and Business Administration
1. Introduction
Introduction
If have data, how to examine male-female difference in salary of accountants? If have data, how to examine male-female difference in salary of accountants after consideration of the difference of experiences? If have data, how to examine difference of management (directors of board) performance due to difference of education?
The estimated mean salary of female accountants is $35,200
Accountant Example
Estimated mean salary of male accountants is $45,450 Gender differential is statistically significant since b2 is significant.
Introduction
We can have dummy variables as explanatory variables along with quantitative variables or other dummy variables.
Accountant Example
Suppose examine male-female difference in salary of accountants Estimate:
Y=-5.3+2.7Dhigh+9.6Dcollege+.2X t (-7.9) (1.5) (2.3) (5.9) Holding education constant, as income increases by $1, average health care spending increases by 20 cents.
Estimating Model
Estimating model:
Y= b1+b2Dhigh +b3Dcollege+b4X+e
Y is annual health care spending X is annual income
Graphically, we have three regression lines with different intercepts, but the same slope:
Changing Omitted Category
Now make male the omitted category (the category equal to 0)
Y = b 1 + b 2D + b3X + e
Now D is 1 for female, 0 for male
Mean salary of male accountant:
Mean salary of female accountant:
E(Y|X, D=0) = b1 +b3X
Add Quantitative Variable
Mean salary of male accountant:
E(Y|X, D=1) = b1 + b2D + b3X
Graphically, we are assuming the same slope but different intercepts.
Y = b1 + b2D + e
Y is annual salary of accountant D is 1 if male and 0 if female.
Accountant Example
The mean salary of a female accountant is: E(Y|D=0) = b1 + b2(0) = b1 The mean salary of a male accountant is: E(Y|D=1) = b1 + b2 (1) = b1 + b2
Introduction
Sometimes the explanatory variables are qualitative (dummy variables)
Ex: gender, race, religion, region. Examples:
1 indicates male and 0 female. 1 indicates living in the South and 0 not living in the South. 1 indicates Republican and 0 Democrat.
Accountant Example
The intercept term gives the mean salary of a female accountant The dummy coefficient indicates how much the mean salary of a male differs from a female. The mean salary of males is the intercept plus dummy coefficient. Graph is a step function
D2 is 1- D1
D1 and D2 are perfectly collinear and so we can’t include both . Always leave out one of the dummy variable categories.
3. Model with Multiple Category Qualitative Variable and Quantitative Variable