微观计量经济学模型ModelofMicroeconometricsdoc.docx

上传人:b****5 文档编号:3231651 上传时间:2022-11-20 格式:DOCX 页数:15 大小:72.85KB
下载 相关 举报
微观计量经济学模型ModelofMicroeconometricsdoc.docx_第1页
第1页 / 共15页
微观计量经济学模型ModelofMicroeconometricsdoc.docx_第2页
第2页 / 共15页
微观计量经济学模型ModelofMicroeconometricsdoc.docx_第3页
第3页 / 共15页
微观计量经济学模型ModelofMicroeconometricsdoc.docx_第4页
第4页 / 共15页
微观计量经济学模型ModelofMicroeconometricsdoc.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

微观计量经济学模型ModelofMicroeconometricsdoc.docx

《微观计量经济学模型ModelofMicroeconometricsdoc.docx》由会员分享,可在线阅读,更多相关《微观计量经济学模型ModelofMicroeconometricsdoc.docx(15页珍藏版)》请在冰豆网上搜索。

微观计量经济学模型ModelofMicroeconometricsdoc.docx

微观计量经济学模型ModelofMicroeconometricsdoc

微观计量经济学模型(ModelofMicroeconometrics)

1.1GeneralizedLinearModels

Threeaspectsofthelinearregressionmodelforaconditionallynormallydistributedresponseyare:

(1)Thelinearpredictor

throughwhich

.

(2)

is

(3)

GLMs:

extends

(2)and(3)tomoregeneralfamiliesofdistributionsfory.Specifically,

mayfollowadensity:

:

canonicalparameter,dependsonthelinearpredictor.

:

dispersionparameter,isoftenknown.

Also

and

arerelatedbyamonotonictransformation,

CalledthelinkfunctionoftheGLM.

 

SelectedGLMfamiliesandtheircanonicallink

Family

Canonicallink

Name

binomial

logit

gaussian

identity

poisson

log

1.2BinaryDependentVariables

Model:

Intheprobitcase:

equalsthestandardnormalCDF

Inthelogitcase:

equalsthelogisticCDF

Example:

(1)Data

Consideringfemalelaborparticipationforasampleof872womenfromSwitzerland.

Thedependentvariable:

participation

Theexplainvariables:

income,age,education,youngkids,oldkids,foreignyesandage^2.

R:

library("AER")

data("SwissLabor")

summary(SwissLabor)

participationincomeageeducation

no:

471Min.:

7.187Min.:

2.000Min.:

1.000

yes:

4011stQu.:

10.4721stQu.:

3.2001stQu.:

8.000

Median:

10.643Median:

3.900Median:

9.000

Mean:

10.686Mean:

3.996Mean:

9.307

3rdQu.:

10.8873rdQu.:

4.8003rdQu.:

12.000

Max.:

12.376Max.:

6.200Max.:

21.000

youngkidsoldkidsforeign

Min.:

0.0000Min.:

0.0000no:

656

1stQu.:

0.00001stQu.:

0.0000yes:

216

Median:

0.0000Median:

1.0000

Mean:

0.3119Mean:

0.9828

3rdQu.:

0.00003rdQu.:

2.0000

Max.:

3.0000Max.:

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)

DevianceResiduals:

Min1QMedian3QMax

-1.9191-0.9695-0.47921.02092.4803

Coefficients:

EstimateStd.ErrorzvaluePr(>|z|)

(Intercept)3.749091.406952.6650.00771**

income-0.666940.13196-5.0544.33e-07***

age2.075300.405445.1193.08e-07***

education0.019200.017931.0710.28428

youngkids-0.714490.10039-7.1171.10e-12***

oldkids-0.146980.05089-2.8880.00387**

foreignyes0.714370.121335.8883.92e-09***

I(age^2)-0.294340.04995-5.8933.79e-09***

---

Signif.codes:

0‘***’0.001‘**’0.01‘*’0.05‘.’0.1‘’1

(Dispersionparameterforbinomialfamilytakentobe1)

Nulldeviance:

1203.2on871degreesoffreedom

Residualdeviance:

1017.2on864degreesoffreedom

AIC:

1033.2

NumberofFisherScoringiterations:

4

(3)Visualization

Plottingparticipationversusage

R:

plot(participation~age,data=SwissLabor,ylevels=2:

1)

(4)Effects

Averagemarginaleffects:

Theaverageofthesamplemarginaleffects:

R:

fav=mean(dnorm(predict(swiss_prob,type="link")))

fav*coef(swiss_prob)

(Intercept)incomeageeducationyoungkids

1.241929965-0.2209318580.6874661850.006358743-0.236682273

oldkidsforeignyesI(age^2)

-0.0486901700.236644422-0.097504844

Theaveragemarginaleffectsattheaverageregressor:

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)incomeageeducationyoungkids

1.495137092-0.2659758800.8276281450.007655177-0.284937521

oldkidsI(age^2)

-0.058617218-0.117384323

 

Foreign:

(Intercept)incomeageeducationyoungkids

1.136517140-0.2021795510.6291152680.005819024-0.216593099

oldkidsI(age^2)

-0.044557434-0.089228804

(5)Goodnessoffitandprediction

Pseudo-R2:

asthelog-likelihoodforthefittedmodel,

asthelog-likelihoodforthemodelcontainingonlyaconstantterm.

R:

swiss_prob0=update(swiss_prob,formula=.~1)

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

[1]0.1546416

Percentcorrectlypredicted:

R:

table(true=SwissLabor$participation,pred=round(fitted(swiss_prob)))

pred

true01

no337134

yes146255

67.89%

ROCcurve:

TPR(c):

thenumberofwomenparticipatinginthelaborforcethatareclassifiedasparticipatingcomparedwiththetotalnumberofwomenparticipating.

FPR(c):

thenumberofwomennotparticipatinginthelaborforcethatareclassifiedasparticipatingcomparedwiththetotalnumberofwomennotparticipating.

R:

library("ROCR")

pred=prediction(fitted(swiss_prob),SwissLabor$participation)

plot(performance(pred,"acc"))

plot(performance(pred,"tpr","fpr"))

abline(0,1,lty=2)

 

●Extensions:

Multinomialresponses

Forillustratingthemostbasicversionofthemultinomiallogitmodel,amodelwithonlyindividual-specificcovariates,.

data("BankWages")

Itcontains,foremployeesofaUSbank,anordere

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 医药卫生 > 预防医学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1