劳动经济学学习笔记I-1
经管之家:Do the best economic and management education!
作者: 刘旭东, 英文名 , Daniel Tulips Liu.
大学: 重庆工商大学。
文档类型:使用 Markdown 与 Katex 完成劳动经济学学习笔记的分享。本文为自主学习笔记的原创,虽然采用的是已经在cran 官方收录的R 工具包作者里的参考文献以及程序代码学习。但是,是在经管之家整理 Markdown 文件的学习笔记,严谨申明, 文责自负。
摘要
限于篇幅,本文是在论坛劳动经济学板块,我入门学习劳动经济学三年,在这里第一次学术研讨会 学习笔记的分享与国内经济学界的同仁交流劳动经济学,欢迎各位同仁留下宝贵的交流讨论,共同学习,共同进步。 展望未来,也希望与国内劳动经济学界交流居民收入分配以及衡量财富不均衡以及不平等的基尼系数计算 (Gini Index, Lorenz curve, Theil Index etc)。 限于论坛 Markwown 篇幅限制的原因,本文分为两部分,这部分是程序代码, Katex 数学公式,会在第二篇学习笔记中分享数学公式。
关键字: Heckman sample selaction mothod, probit model, Labour Economic.
模型设定
本文假定家庭部分是异质性的。 效用函数采用双曲线风险厌恶函数。 . The dynamic programming reads
引用工具包以及模型估计代码
- 本文引用工具包的程序打印,如下:
print(citation("sampleSelection"), bibtex = TRUE) To cite sampleSelection in publications use:
Ott Toomet, Arne Henningsen (2008). Sample Selection Models in R: Package sampleSelection. Journal of
Statistical Software 27(7). URL https://www.jstatsoft.org/v27/i07/.
LaTeX的用户的BibTeX条目是
@Article{,
title = {Sample Selection Models in {R}: Package {sampleSelection}},
author = {Ott Toomet and Arne Henningsen},
journal = {Journal of Statistical Software},
year = {2008},
volume = {27},
number = {7},
url = {https://www.jstatsoft.org/v27/i07/},
}
- 程序代码
## Greene( 2003 ): example 22.8, page 786
data( Mroz87 )
Mroz87$kids <- ( Mroz87$kids5 + Mroz87$kids618 > 0 )
# Two-step estimation
summary( heckit( lfp ~ age + I( age^2 ) + faminc + kids + educ,
wage ~ exper + I( exper^2 ) + educ + city, Mroz87 ) )
# ML estimation
summary( selection( lfp ~ age + I( age^2 ) + faminc + kids + educ,
wage ~ exper + I( exper^2 ) + educ + city, Mroz87 ) )
## Example using binary outcome for selection model.
## We estimate the probability of womens' education on their
## chances to get high wage (> $5/hr in 1975 USD), using PSID data
## We use education as explanatory variable
## and add age, kids, and non-work income as exclusion restrictions.
data(Mroz87)
m <- selection(lfp ~ educ + age + kids5 + kids618 + nwifeinc,
wage >= 5 ~ educ, data = Mroz87 )
summary(m)
## example using random numbers
library( "mvtnorm" )
nObs <- 1000
sigma <- matrix( c( 1, -0.7, -0.7, 1 ), ncol = 2 )
errorTerms <- rmvnorm( nObs, c( 0, 0 ), sigma )
myData <- data.fr ame( no = c( 1:nObs ), x1 = rnorm( nObs ), x2 = rnorm( nObs ),
u1 = errorTerms[ , 1 ], u2 = errorTerms[ , 2 ] )
myData$y <- 2 + myData$x1 + myData$u1
myData$s <- ( 2 * myData$x1 + myData$x2 + myData$u2 - 0.2 ) > 0
myData$y[ !myData$s ] <- NA
myOls <- lm( y ~ x1, data = myData)
summary( myOls )
myHeckit <- heckit( s ~ x1 + x2, y ~ x1, myData, print.level = 1 )
summary( myHeckit )
## example using random numbers with IV/2SLS estimation
library( "mvtnorm" )
nObs <- 1000
sigma <- matrix( c( 1, 0.5, 0.1, 0.5, 1, -0.3, 0.1, -0.3, 1 ), ncol = 3 )
errorTerms <- rmvnorm( nObs, c( 0, 0, 0 ), sigma )
myData <- data.fr ame( no = c( 1:nObs ), x1 = rnorm( nObs ), x2 = rnorm( nObs ),
u1 = errorTerms[ , 1 ], u2 = errorTerms[ , 2 ], u3 = errorTerms[ , 3 ] )
myData$w <- 1 + myData$x1 + myData$u1
myData$y <- 2 + myData$w + myData$u2
myData$s <- ( 2 * myData$x1 + myData$x2 + myData$u3 - 0.2 ) > 0
myData$y[ !myData$s ] <- NA
myHeckit <- heckit( s ~ x1 + x2, y ~ w, data = myData )
summary( myHeckit ) # biased!
myHeckitIv <- heckit( s ~ x1 + x2, y ~ w, data = myData, inst = ~ x1 )
summary( myHeckitIv ) # unbiased
## tobit-5 example
N <- 500
library(mvtnorm)
vc <- diag(3)
vc[lower.tri(vc)] <- c(0.9, 0.5, 0.6)
vc[upper.tri(vc)] <- vc[lower.tri(vc)]
eps <- rmvnorm(N, rep(0, 3), vc)
xs <- runif(N)
ys <- xs + eps[,1] > 0
xo1 <- runif(N)
yo1 <- xo1 + eps[,2]
xo2 <- runif(N)
yo2 <- xo2 + eps[,3]
a <- selection(ys~xs, list(yo1 ~ xo1, yo2 ~ xo2))
summary(a)
## tobit2 example
vc <- diag(2)
vc[2,1] <- vc[1,2] <- -0.7
eps <- rmvnorm(N, rep(0, 2), vc)
xs <- runif(N)
ys <- xs + eps[,1] > 0
xo <- runif(N)
yo <- (xo + eps[,2])*(ys > 0)
a <- selection(ys~xs, yo ~xo)
summary(a)
## Example for treatment regressions
## Estimate the effect of treatment on income
## selection outcome: treatment participation, logical (treatment)
## selection explanatory variables: age, education (years)
## unemployment in 1974, 1975, race
## outcome: log real income 1978
## outcome explanatory variables: treatment, age, education, race.
## unemployment variables are treated as exclusion restriction
data(Treatment, package="Ecdat")
a <- treatReg(treat~poly(age,2) + educ + u74 + u75 + ethn,
log(re78)~treat + poly(age,2) + educ + ethn,
data=Treatment)
print(summary(a))
- Estimated results
Heckman model
--------------------------------------------
Tobit 2 model (sample selection model)
2-step Heckman / heckit estimation
753 observations (325 censored and 428 observed)
14 free parameters (df = 740)
Probit selection equation:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -4.157e+00 1.402e+00 -2.965 0.003127 **
age 1.854e-01 6.597e-02 2.810 0.005078 **
I(age^2) -2.426e-03 7.735e-04 -3.136 0.001780 **
faminc 4.580e-06 4.206e-06 1.089 0.276544
kidsTRUE -4.490e-01 1.309e-01 -3.430 0.000638 ***
educ 9.818e-02 2.298e-02 4.272 2.19e-05 ***
Outcome equation:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.9712003 2.0593505 -0.472 0.637
exper 0.0210610 0.0624646 0.337 0.736
I(exper^2) 0.0001371 0.0018782 0.073 0.942
educ 0.4170174 0.1002497 4.160 3.56e-05 ***
city 0.4438379 0.3158984 1.405 0.160
Multiple R-Squared:0.1264, Adjusted R-Squared:0.116
Error terms:
Estimate Std. Error t value Pr(>|t|)
invMillsRatio -1.098 1.266 -0.867 0.386
sigma 3.200 NA NA NA
rho -0.343 NA NA NA
--------------------------------------------
Tobit 2
Tobit 2 model (sample selection model)
Maximum Likelihood estimation
Newton-Raphson maximisation, 5 iterations
Return code 8: successive function values within relative tolerance limit (reltol)
Log-Likelihood: -1581.258
753 observations (325 censored and 428 observed)
13 free parameters (df = 740)
Probit selection equation:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -4.120e+00 1.401e+00 -2.942 0.003368 **
age 1.840e-01 6.587e-02 2.794 0.005345 **
I(age^2) -2.409e-03 7.723e-04 -3.119 0.001886 **
faminc 5.680e-06 4.416e-06 1.286 0.198782
kidsTRUE -4.506e-01 1.302e-01 -3.461 0.000568 ***
educ 9.528e-02 2.315e-02 4.115 4.3e-05 ***
Outcome equation:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.9630242 1.1982209 -1.638 0.102
exper 0.0278683 0.0615514 0.453 0.651
I(exper^2) -0.0001039 0.0018388 -0.056 0.955
educ 0.4570051 0.0732299 6.241 7.33e-10 ***
city 0.4465290 0.3159209 1.413 0.158
Error terms:
Estimate Std. Error t value Pr(>|t|)
sigma 3.1084 0.1138 27.307 <2e-16 ***
rho -0.1320 0.1651 -0.799 0.424
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- Related Literature
[1]: Cameron, A. C. and Trivedi, P. K. (2005) Microeconometrics: Methods and Applications, Cambridge University Press.
[2]: Greene, W. H. (2003) Econometric Analysis, Fifth Edition, Prentice Hall.
[3]: Heckman, J. (1976) The common structure of statistical models of truncation, sample selection and limited dependent variables and a simple estimator for such models, Annals of Economic and Social Measurement, 5(4), p. 475-492.
[4]: Johnston, J. and J. DiNardo (1997) Econometric Methods, Fourth Edition, McGraw-Hill.
[5]: Lee, L., G. Maddala and R. Trost (1980) Asymetric covariance matrices of two-stage probit and two-stage tobit methods for simultaneous equations models with selectivity. Econometrica, 48, p. 491-503.
[6]: Toomet, O. and A. Henningsen, (2008) Sample Selection Models in R: Package sampleSelection. Journal of Statistical Software 27(7), https://www.jstatsoft.org/v27/i07/
[7]: Wooldridge, J. M. (2003) Introductory Econometrics: A Modern Approach, 2e, Thomson South-Western.