微观计量经济学模型(Model of Microeconometrics)

  • 格式:doc
  • 大小:155.00 KB
  • 文档页数:17

1 微观计量经济学模型(Model of Microeconometrics) 1.1 Generalized Linear Models Three aspects of the linear regression model for a conditionally normally distributed response y are: (1) The linear predictor Tiix through which )|(iiixyE. (2) iixy| is ),(2iN (3) ii

GLMs: extends (2)and(3) to more general families of distributions for y. Specifically, iixy| may follow a density:

);()(exp),;(ycby

yf

:canonical parameter, depends on the linear predictor. :dispersion parameter, is often known. Also i and i are related by a monotonic transformation,

iig)( Called the link function of the GLM. 2

Selected GLM families and their canonical link Family Canonical link Name binomial ))1/(log( logit gaussian  identity poisson log log

1.2 Binary Dependent Variables Model: nixFpxyETiiii,......2,1),()|( In the probit case: F equals the standard normal CDF In the logit case: F equals the logistic CDF Example: (1)Data Considering female labor participation for a sample of 872 women from Switzerland. The dependent variable: participation The explain variables: income,age,education,youngkids,oldkids,foreignyesandage^2. R: library("AER") 3

data("SwissLabor") summary(SwissLabor) participation income age education no :471 Min. : 7.187 Min. :2.000 Min. : 1.000 yes:401 1st Qu.:10.472 1st Qu.:3.200 1st Qu.: 8.000 Median :10.643 Median :3.900 Median : 9.000 Mean :10.686 Mean :3.996 Mean : 9.307 3rd Qu.:10.887 3rd Qu.:4.800 3rd Qu.:12.000 Max. :12.376 Max. :6.200 Max. :21.000 youngkids oldkids foreign Min. :0.0000 Min. :0.0000 no :656 1st Qu.:0.0000 1st Qu.:0.0000 yes:216 Median :0.0000 Median :1.0000 Mean :0.3119 Mean :0.9828 3rd Qu.:0.0000 3rd Qu.:2.0000 Max. :3.0000 Max. :6.0000

(2) Estimation R: swiss_prob=glm(participation~.+I(age^2),data=SwissLabor,family=binomial(link="probit")) summary(swiss_prob)

Call: glm(formula = participation ~ . + I(age^2), family = binomial(link = "probit"), data = SwissLabor)

Deviance Residuals: Min 1Q Median 3Q Max -1.9191 -0.9695 -0.4792 1.0209 2.4803

Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 3.74909 1.40695 2.665 0.00771 ** income -0.66694 0.13196 -5.054 4.33e-07 *** age 2.07530 0.40544 5.119 3.08e-07 *** education 0.01920 0.01793 1.071 0.28428 youngkids -0.71449 0.10039 -7.117 1.10e-12 *** oldkids -0.14698 0.05089 -2.888 0.00387 ** foreignyes 0.71437 0.12133 5.888 3.92e-09 *** I(age^2) -0.29434 0.04995 -5.893 3.79e-09 *** --- 4

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 1203.2 on 871 degrees of freedom Residual deviance: 1017.2 on 864 degrees of freedom AIC: 1033.2

Number of Fisher Scoring iterations: 4 (3) Visualization

Plotting participation versus age R:plot(participation~age,data=SwissLabor,ylevels=2:1) 5

(4) Effects jTiijTiij

iixxxxxyE)(

)()|(

Average marginal effects: The average of the sample marginal effects: jTi

n

ixn)(

1

R:fav=mean(dnorm(predict(swiss_prob,type="link"))) fav*coef(swiss_prob)

(Intercept) income age education youngkids 1.241929965 -0.220931858 0.687466185 0.006358743 -0.236682273 oldkids foreignyes I(age^2) -0.048690170 0.236644422 -0.097504844

The average marginal effects at the average regressor: R: av=colMeans(SwissLabor[,-c(1,7)]) av=data.frame(rbind(swiss=av,foreign=av),foreign=factor(c("no","yes"))) av=predict(swiss_prob,newdata=av,type="link") av=dnorm(av) av["swiss"]*coef(swiss_prob)[-7] av["foreign"]*coef(swiss_prob)[-7]

swiss: (Intercept) income age education youngkids 1.495137092 -0.265975880 0.827628145 0.007655177 -0.284937521 oldkids I(age^2) -0.058617218 -0.117384323 6

Foreign: (Intercept) income age education youngkids 1.136517140 -0.202179551 0.629115268 0.005819024 -0.216593099 oldkids I(age^2) -0.044557434 -0.089228804

(5) Goodness of fit and prediction Pseudo-R2:

)()ˆ(12R

)ˆ(as the log-likelihood for the fitted model, )()ˆ(as the

log-likelihood for the model containing only a constant term. R: swiss_prob0=update(swiss_prob,formula=.~1)

1- as.vector(logLik(swiss_prob)/logLik(swiss_prob0))

[1] 0.1546416

Percent correctly predicted: R:table(true=SwissLabor$participation,pred=round(fitted(swiss_prob)))

pred true 0 1 no 337 134 yes 146 255 67.89% ROC curve: TPR(c):the number of women participating in the labor force that are classified as participating compared with the total number of women