第7章 虚拟变量_第1页
第7章 虚拟变量_第2页
第7章 虚拟变量_第3页
第7章 虚拟变量_第4页
第7章 虚拟变量_第5页
已阅读5页,还剩82页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Multiple Regression Analysis y = b0 + b1x1 + b2x2 + . . . bkxk + u 5. Dummy VariablesChapter Outline1. 描述定性信息描述定性信息Describing Qualitative Information2. 一个虚拟变量作解释变量一个虚拟变量作解释变量A Single Dummy Independent Variable3. 用多个虚拟变量表示多种分类数据用多个虚拟变量表示多种分类数据Using Dummy Variables For Multiple Categories4. 与虚拟变量有关的交互

2、项与虚拟变量有关的交互项Interactions Involving Dummy Variables5. 虚拟变量作因变量:线性概率模型虚拟变量作因变量:线性概率模型A Binary Dependent Variable: The Linear Probability Model6. 关于政策分析与项目评价的进一步讨论关于政策分析与项目评价的进一步讨论More On Policy Analysis And Program EvaluationLecture Outline 1. 定性信息与虚拟变量定性信息与虚拟变量Qualitative information & Dummy Vari

3、ables 2. 虚拟变量作为解释变量虚拟变量作为解释变量(截距项截距项)Dummy Independent Variables 3. 与虚拟变量有关的交互项与虚拟变量有关的交互项Interactions Involving Dummy Variables:Chow test定性信息与虚拟变量定性信息与虚拟变量Qualitative information & Dummy Variables数量信息与定性信息数量信息与定性信息Quantitative & Qualitative information 连续变量(Continuous Variables): Quantitati

4、ve information: wage, years of education, experience, weight, sales, price, pop 离散变量(Discrete Variables): Qualitative information: gender (1: male 2: female); race(1.black; 2. white; 3. others); marital status (1: single; 2: married); region(1. eastern; 2. central ; 3. western); education attainment

5、 (1: primary; 2: junior 3. high; 4: college) training (1. trainees; 2. nontrainees); insurance(1. participating; 2. not participating); industry (1.agriculture; 2: manufacture; 3: service;4. others) Income groups (1. 5000); age group (1. 60); Ordinal variables: Credit rating (low to high: 1 2 3 4 5)

6、;Dummy Variables & Qualitative information A dummy variable 是一种只取1或0两个数值的变量. Examples: (1) sex: 1: male 2: female male (= 1 if male, 0 otherwise); female (= 1 if female, 0 otherwise)(2) region: 1. eastern; 2. central ; 3. western) eastern (=1 if eastern, 0 otherwise); central (=1 if central, 0 o

7、therwise) western (=1 if western, 0 otherwise) Dummy variables are also called: 二值变量(binary variables), 0-1变量(zero-one variables)2. 虚拟变量作为解释变量虚拟变量作为解释变量(截距项截距项)Dummy Independent Variables2. 虚拟变量作为解释变量虚拟变量作为解释变量 Case 1: y = b0 + d0d + b1x + u Case 2: y = b0 + d1d1 + d1d2 + b1x + u Case 3: y = b0 + d1

8、d1 + d1d2 + d1d1d2 + b1x + u Case 4: y = b0 + d0d + d1dx+b1x + u d: dummy variable虚拟变量Case 1: y = b0 + d0d + b1x + u 考虑一个简单工资方程: wage = b0 + d0 female + b1 educ + u If female =0, then wage = b0 + b1educ + u If female =1, then wage = (b0 + d0) + b1educ + u d0 can be interpreted as an intercept shift

9、(截距项变动)wage = b0 + d0 female + b1 educ + u 在零值条件期望假定( zero conditional mean)下: E(wage| female, educ) = b0 + d0 female + b1 educ (1) E(wage| female=1, educ) = (b0 + d0 ) + b1 educ (2) E(wage| female=0, educ) = b0 + b1 educ d0 = E(wage| female=1, educ) - E(wage| female=0, educ) d0 (an intercept shift)

10、: 给定教育年限educ,女性平均工资比男性平均工资高d0元。 Example of d0 0E(wage|female,educ) = b0 + d0 female + b1 educ Example of d0 0 and d1 0wage = b0 + d0female+ d1female*educ+ b1educ+u = (b0 + d0female)+ (d1female+ b1)educ+uFemale: female = 1Male: female = 0b0 + d0b0 检验不同群体之间工资方程的差异F test & Chow test 简单工资方程: wage =

11、b0 + b1educ+u (p) 不同性别之间的工资方程可能是不同的: Female: wage = b0f + b1f educ + u (f ) Female: wage = b0m + b1m educ + u (m) H0: b0f = b0m, b1f = b1m; H1:H0 is not true.F test 方法1:F test wage =b0 + d0female+ b1educ + d1female*educ +u (UR) H0: d0=0, d1=0; H1: H0 is not true wage = b0 + b1educ+u (R) F test: (SSR

12、r-SSRur)/(k+1) / SSRur/n-2(k+1)一种简便F test: Chow test (1) 用女性(female=1)子样本估计女性工资方程(f),用男性 (female=0)子样本估计男性工资方程(m), 分别得到SSRf和SSRm, 则有无约束工资方程的SSRur可以写作:SSRur= SSRf+SSRm (2) 用所有群体(男、女)混合(pooling)在一起的总样本, 估计受约束工资方程(R), 得到SSRr; (由于受约束模型是用所有群体混合(pooling)在一起的总样本,故作者记作:SSRp = SSRr ) (3) F test: (k工资方程(p)中解释

13、变量的个数)1(2/)() 1/()()1(2/) 1/()(knSSRSSRkSSRSSRSSRknSSRkSSRSSRFmfmfpururr更多解释变量的回归方程 工资方程: lwage = b0 + b1educ+ b2exper+ u (p) 不同性别之间的工资方程可能是不同的: Female: lwage = b0f + b1f educ+b2fexper + u (f ) male: lwage = b0m + b1m educ+b2mexper + u (m) H0: b0f = b0m, b1f = b1m , b2f = b2m; H1:H0 is not true. lwa

14、ge = b0 + d0female+b1educ+ d1female*educ +b2exper +d2female*exper +u (UR) H0: d0=0, d1=0 , d2=0; H1: H0 is not true lwage = b0 +b1educ+b2exper +u (R)不同时期的结构方程差异 lwage = b0 + b1educ+ b2exper+ u (p) 不同时期之间的工资方程可能是不同的: 1995: lwage = b095 + b195 educ+b295exper + u (95) 2001: lwage = b001 + b101 educ+b20

15、1exper + u (01) H0: b095 = b001, b195 = b101 , b295 = b201; H1:H0 is not true.2 year samples: Define: s01 (=1 if year=2001, 0 if year=1995) lwage = b0 + d0s01+b1educ+ d1s01*educ +b2exper +d2s01*exper +u (UR) H0: d0=0, d1=0 , d2=0; H1: H0 is not true lwage = b0 +b1educ+b2exper +u (R)关于Chow test Chow

16、test是F test的一种特例,因此,需要同方差假定(MRL5): 不同群体(如男女)之间,误差方差相同:Var(uf|x)=Var(um|x)=s2 Chow test中,须注意估计不同方程,样本也不同:子群体方程需用子样本,受约束方程需用所有群体混合在一起的总样本。其他应用:允许截距不同,检验斜率是否相同 不同性别, 工资方程的截距参数不同: lwage = b0 + d0female + b1educ+ b2exper+ u (p) 不同性别之间, 工资方程的斜率参数也可能不同: Female: lwage = b0f + b1f educ+b2fexper + u (f ) male

17、: lwage = b0m + b1m educ+b2mexper + u (m) H0: b1f = b1m , b2f = b2m; H1:H0 is not true. lwage = b0 + d0female +b1educ+ d1female*educ +b2exper +d2female*exper +u (UR) H0: d1=0 , d2=0; H1: H0 is not true lwage = b0 + d0female + b1educ+ b2exper+ u (R) 方法1: F test 方差2:类似Chow test 用女性样本估计方程(f),得SSRf;用女性样

18、本估计方程(m),得SSRm: SSRur=SSRf+SSRm 估计受约束方程(R), SSRr . 注:(R)中含有dummy:female; 在(R)中,则不含 计算F统计量总结 1. 定性信息与虚拟变量定性信息与虚拟变量Qualitative information & Dummy Variables 2. 虚拟变量作为解释变量虚拟变量作为解释变量(截距项截距项)Dummy Independent Variables 3. 与虚拟变量有关的交互项与虚拟变量有关的交互项Interactions Involving Dummy Variables:Chow test作业与思考题 思考

19、题:7.1, 7.2, 7.6 计算机练习:7.10,7.15Multiple Regression Analysis y = b0 + b1x1 + b2x2 + . . . bkxk + u 5. Dummy VariablesChapter Outline1. 描述定性信息描述定性信息Describing Qualitative Information2. 一个虚拟变量作解释变量一个虚拟变量作解释变量A Single Dummy Independent Variable3. 用多个虚拟变量表示多种分类数据用多个虚拟变量表示多种分类数据Using Dummy Variables For M

20、ultiple Categories4. 与虚拟变量有关的交互项与虚拟变量有关的交互项Interactions Involving Dummy Variables5. 虚拟变量作因变量:线性概率模型虚拟变量作因变量:线性概率模型A Binary Dependent Variable: The Linear Probability Model6. 关于政策分析与项目评价的进一步讨论关于政策分析与项目评价的进一步讨论More On Policy Analysis And Program EvaluationLecture Outline 1. 定性信息与虚拟变量定性信息与虚拟变量Qualitati

21、ve information & Dummy Variables 2. 虚拟变量作为解释变量虚拟变量作为解释变量Dummy Independent Variables 3. 虚拟变量作因变量虚拟变量作因变量Dummy Dependent Variable 4. 政策分析中的选择性与内生性政策分析中的选择性与内生性Selection And Endogeneity In Policy Analysis定性信息与虚拟变量定性信息与虚拟变量Qualitative information & Dummy Variables数量信息与定性信息数量信息与定性信息Quantitative &

22、amp; Qualitative information 连续变量(Continuous Variables): Quantitative information: wage, years of education, experience, weight, sales, price, pop 离散变量(Discrete Variables): Qualitative information: gender (1: male 2: female); race(1.black; 2. white; 3. others); marital status (1: single; 2: married)

23、; region(1. eastern; 2. central ; 3. western); education attainment (1: primary; 2: junior 3. senior; 4: college) training (1. trainees; 2. nontrainees); insurance(1. participant; 2. nonparticipants); industry (1.agriculture; 2: manufacture; 3: service;4. others) Income groups (1. 5000); age group (

24、1. 60); Ordinal variables: Credit rating (low to high: 1 2 3 4 5);虚拟变量与定性信息虚拟变量与定性信息Dummy Variables & Qualitative information 虚拟变量虚拟变量(A dummy variable) 是一种只取1或0两个数值的变量. 虚拟变量可以用来表示定性信息:Examples: (1) sex: 1: male 2: female male (= 1 if male, 0 otherwise); female (= 1 if female, 0 otherwise)(2) re

25、gion: 1. eastern; 2. central ; 3. western) eastern (=1 if eastern, 0 otherwise); central (=1 if central, 0 otherwise) western (=1 if western, 0 otherwise) Dummy variables are also called: 二值变量(binary variables), 0-1变量(zero-one variables)Dummy Varibles2. 虚拟变量作为解释变量虚拟变量作为解释变量 Dummy Independent Variabl

26、es Case 1: y = b0 + d0d + b1x + u Case 2: y = b0 + d1d1 + d1d2 + b1x + u Case 3: y = b0 + d1d1 + d1d2 + d1d1d2 + b1x + u Case 4: y = b0 + d0d + d1dx+b1x + u d: dummy variable虚拟变量Case 1: y = b0 + d0d + b1x + u 考虑一个简单工资方程: wage = b0 + d0 female + b1 educ + u If female =0, then wage = b0 + b1educ + u I

27、f female =1, then wage = (b0 + d0) + b1educ + u d0 can be interpreted as an intercept shift (截距项变动)wage = b0 + d0 female + b1 educ + u 在零值条件期望假定( zero conditional mean)下: (1) E(wage|female,educ)= b0 + d0 female + b1 educ (2) E(wage| female=1, educ) = (b0 + d0 ) + b1 educ (3) E(wage| female=0, educ)

28、= b0 + b1 educ d0 = E(wage| female=1, educ) - E(wage| female=0, educ) d0 (an intercept shift): 给定教育年限educ,女性平均工资比男性平均工资高d0元。 Example of d0 0E(wage|female,educ) = b0 + d0 female + b1 educ Example of d0 0 E(wage|female,educ) = b0 + d0 female + b1 educ回归结果wage = b0 + d0 female + b1 educ + uIf female =0

29、, then lwage = b0 + b1educ If female =1, then lwage = (b0 + d0) + b1educ d0 0 and d1 0wage = b0 + d0female+ d1female*educ+ b1educ+u = (b0 + d0female)+ (d1female+ b1)educ+uFemale: female = 1Male: female = 0b0 + d0b0 检验不同群体之间工资方程的差异F test & Chow test 简单工资方程: wage = b0 + b1educ+u (p) 不同性别之间的工资方程可能是

30、不同的: Female: wage = b0f + b1f educ + u (f ) Female: wage = b0m + b1m educ + u (m) H0: b0f = b0m, b1f = b1m; H1:H0 is not true.F test 方法1:F test wage =b0 + d0female+ b1educ + d1female*educ +u (UR) H0: d0=0, d1=0; H1: H0 is not true wage = b0 + b1educ+u (R) F test: (SSRr-SSRur)/(k+1) / SSRur/n-2(k+1)一

31、种简便F test: Chow test (1) 用女性(female=1)子样本估计女性工资方程(f),用男性 (female=0)子样本估计男性工资方程(m), 分别得到SSRf和SSRm, 则有无约束工资方程的SSRur可以写作:SSRur= SSRf+SSRm (2) 用所有群体(男、女)混合(pooling)在一起的总样本, 估计受约束工资方程(R), 得到SSRr; (由于受约束模型是用所有群体混合(pooling)在一起的总样本,故作者记作:SSRp = SSRr ) (3) F test: (k工资方程(p)中解释变量的个数)1(2/)() 1/()()1(2/) 1/()(k

32、nSSRSSRkSSRSSRSSRknSSRkSSRSSRFmfmfpururr工资方程的性别差异:更多解释变量的回归方程 工资方程: lwage = b0 + b1educ+ b2exper+ u (p) 不同性别之间的工资方程可能是不同的: Female: lwage = b0f + b1f educ+b2fexper + u (f ) male: lwage = b0m + b1m educ+b2mexper + u (m) H0: b0f = b0m, b1f = b1m , b2f = b2m; H1:H0 is not true. lwage = b0 + d0female+b1e

33、duc+ d1female*educ +b2exper +d2female*exper +u (UR) H0: d0=0, d1=0 , d2=0; H1: H0 is not true lwage = b0 +b1educ+b2exper +u (R)F testChow test不同时期的结构方程差异 lwage = b0 + b1educ+ b2exper+ u (p) 不同时期之间的工资方程可能是不同的: 1995: lwage = b095 + b195 educ+b295exper + u (95) 2001: lwage = b001 + b101 educ+b201exper

34、+ u (01) H0: b095 = b001, b195 = b101 , b295 = b201; H1:H0 is not true.2 year samples: Define: s01 (=1 if year=2001, 0 if year=1995) lwage = b0 + d0s01+b1educ+ d1s01*educ +b2exper +d2s01*exper +u (UR) H0: d0=0, d1=0 , d2=0; H1: H0 is not true lwage = b0 +b1educ+b2exper +u (R)关于Chow test Chow test是F

35、test的一种特例,因此,需要同方差假定(MRL5): 不同群体(如男女)之间,误差方差相同:Var(uf|x)=Var(um|x)=s2 Chow test中,须注意估计不同方程,样本也不同:子群体方程需用子样本,受约束方程需用所有群体混合在一起的总样本。其他应用:允许截距不同,检验斜率是否相同 不同性别, 工资方程的截距参数不同: lwage = b0 + d0female + b1educ+ b2exper+ u (p) 不同性别之间, 工资方程的斜率参数也可能不同: Female: lwage = b0f + b1f educ+b2fexper + u (f ) male: lwage

36、 = b0m + b1m educ+b2mexper + u (m) H0: b1f = b1m , b2f = b2m; H1:H0 is not true. lwage = b0 + d0female +b1educ+ d1female*educ +b2exper +d2female*exper +u (UR) H0: d1=0 , d2=0; H1: H0 is not true lwage = b0 + d0female + b1educ+ b2exper+ u (R) 方法1: F test 方差2:类似Chow test 用女性样本估计方程(f),得SSRf;用女性样本估计方程(m

37、),得SSRm: SSRur=SSRf+SSRm 估计受约束方程(R), SSRr . 注:(R)中含有dummy:female; 在(R)中,则不含 计算F统计量3. 虚拟变量作因变量虚拟变量作因变量Dummy Dependent VariableA Binary Dependent Variable: The Linear Probability Model 以前均是连续变量作因变量: 工资,体重 虚拟变量也可以做因变量: 某个事件是否发生:行为选择结果: 参与劳动力市场:parti: 1: in ; 0: out 参与培训项目:training: 1:trainees; 0: no 是否

38、上大学:college: 1: in; 0: out 虚拟变量所代表的事件: 1: success; 0: failure 将一个虚拟变量y作为因变量: y = b0 + b1x1 + b2x2 + . . . bkxk + u 如何解释参数? MLR.3成立,则: E(y|x) = b0 + b1x1 + b2x2 + . . . Bkxk 参数b1衡量:在给定x2-xk不变的情况下,x变化1单位, y的期望E(y|x)变化多少。 当y 是一个虚拟变量(0-1)时,可以有: E(y|x) = P(y=1|x) 即:给定x, 事件(y=1)发生的概率P(y=1|x), 与y的均值E(y=1|x

39、)是相等的. 故: P(y=1|x) = b0 + b1x1 + b2x2 + . . . bkxk 参数b1解释为:在给定x2-xk不变情况下,x变化1单位, 事件y=1发生的概率P(y=1|x)变化多少。 P(y=1|x): response probability(响应概率) 虚拟变量为因变量的线性回归模型,称线性概率模型(linear probability model, LPM)例:迁移决定模型 教育对劳动力迁移的影响:mig = b0 + b1age + b2agesq+ b3 junior +b4senior+ b5college+ b6married+ b7child + b8

40、citynet +b9distance+ b10discrim+others+ uMig:1:migrants; 0:nonmigrantsEduc: 1: primary; 2: junior; 3. senior;4.collegeLPM的不足之处 1. 预测值可能在0,1之外。 这与预测值的概率解释不一致。 2. 与(1)相关的问题是:事件发生概率P(y=1|x), 与x可能取值之间可能是非线性关系。 LPM假定,在x的不同取值点上,x变化1单位对于P(y=1)的影响(marginal effects, 边际效应)相同。 然而,有时,在x的不同取值点上,x变化1单位对于P(y=1)的影响

41、是不同的:在x的边界值上,x变化1单位对于P(y=1)的影响,与在x均值上,x变化1单位对于P(y=1)的影响,并不相同。 LPM所估计的边际效应,在x均值附近比较准确。 3. LPM 不符合同方差假定(MLR.5). 无法正确OLS估计量的方差(渐近方差),从而影响正确推断。 Var(y|x)= Ey-E(y|x)2=E(y2|x) - E(y|x)2 = E(y|x) - E(y|x)2 = p(x)-p(x)2 = p(x)1-p(x) E(y|x)=P(y=1|x)=p(x), Var(y)=E(y2)-E(y)2 方法:校正异方差LPM的优点 LPM容易估计,容易理解(估计系数即为边际效应)。 在均值附近,对于边际效应估计也比较准确。 关键是,不必对误差项u的分布进行假定。在大样本下,MLR1-4保证OLS估计量具有一致性。4. 政策分析中的选择性与内生性政策分析中的选择性与内生性Selection And Endogeneity In Policy Analysis 虚拟变量的一个经典的应用:评估社会政策/项目效果 例如:性别/种族/户籍歧视,失业保险/医疗保险/低保政策,培训/扶贫项目. 项目评估(program evaluation): 评估某社会政策或项目(如培训)对个人、家庭、企业、社区、地区的影响 通常, 将参加项目者,称为治疗组/试验组(tr

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论