文档介绍:第六章 多元回归分析:虚拟变量
y = b0 + b1x1 + b2x2 + bkxk + u
5 Dummy Variables
腊熙钦扼队绽碾肝钻增嘱驹禽污雕模毡琅希壕寻赠炉芭券耘躁鞠卸基险尉第6章 多元回归分析:虚拟变量第6章 多元回归分析:虚拟变量
1
Dummy Variables
A dummy variable is a variable that takes on the value 1 or 0
Examples: male (= 1 if are male, 0 otherwise), south (= 1 if in the south, 0 otherwise), etc.
Dummy variables are also called binary variables, for obvious reasons
person
wage
educ
female
married
1
2
1
0
2
22
1
1
3
2
0
0
4
44
0
1
5
7
0
1
…
…
…
…
…
525
5
1
1
526
5
0
0
Table: A partial listing of the data in wage1raw
蚌坷卷他瀑搽叭乘赡坐窄疮续侵涂偶蕾栽梧绊满芯讨媚叼记崎爵戏氖公狗第6章 多元回归分析:虚拟变量第6章 多元回归分析:虚拟变量
2
A Dummy Independent Variable
Consider a simple model with one continuous variable (x) and one dummy (d)
y = b0 + d0d + b1x + u
This can be interpreted as an intercept shift
If d = 0, then y = b0 + b1x + u
If d = 1, then y = (b0 + d0) + b1x + u
The case of d = 0 is the base group, then
d0=E(y|x, d=1)-E(y|x, d=0)
抽科挠他静宁茧凉链馏艾洼梗窝蹲敲套郭法迂读蹦好恰懈注事果辨锻媳须第6章 多元回归分析:虚拟变量第6章 多元回归分析:虚拟变量
3
Example of d0 > 0
x
y
}
b0
y = b0 + b1x
slope = b1
d = 0
{
d0
y = (b0 + d0) + b1x
d = 1
(y = b0 + d0d + b1x + u)
钱讳莆裁金踢沉掘羚迢侵寺净运云旋鸥犀瞅辆粉孙烧逾炯堡迈袱馒竞芹柳第6章 多元回归分析:虚拟变量第6章 多元回归分析:虚拟变量
4
Dummies for Multiple Categories
We can use dummy variables to control for something with multiple categories
Wage determinations:
wâge=- - +++
() () () () ()
n=526 R2=
The coefficient of female (-) means the wage of female is $ less per hour than male workers after controlling other variables.
wâge= -
() ()
This means that the average male wage per hour is $, and female’s wage is $ less, which is $ per hour. Is there significant wage difference btw men and women? Yes, it indeed is. Because the t-value of female is -=-
L