版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、安慰剂检验介绍(Placebotest)安慰剂是一种附加实证检验的思路,并不存在一个具体的特定的操作方法。一般存在两种寻找安慰剂变量的方法。比如,在已有的实证检验中,发现自变量Xi会影响自变量Zi与因变量Yi之间存在相关关系。在其后的实证检验中,采用其他主体(国家,省份,公司)的Xj变量作为安慰剂变量,检验Xj是否影响Zi与Yi之间的相关关系。如果不存在类似于Xi的影响,即可排除Xi的安慰剂效应,使得结果更为稳健。另一种寻找安慰剂变量的方法。已知,Xi是虚拟变量,Xi=1,iftT;Xi=0iftT+n;Xi=0iftT+n,其中n根据实际情况取值,可正可负。检验Xi是否影响Zi与Yi之间的相
2、关关系。如果不存在类似于Xi的影响,即可排除Xi的安慰剂效应,使得结果更为稳健。举例:以美国市场某种政策冲击识别策略的因果关系考察,在最后部分选取英国同期的因变量,检验是否有类似的特征,就是安慰剂检验。以中国2007年所得税改革作为减税的政策冲击以验证减税对企业创新的影响。亦可以通过把虚拟的政策实施时间往前往后推几年,作为虚拟的政策时点,如果检验发现没有类似的因果,文章的主要结论就更加可信了。以下是详细的例题,安慰剂检验在最后。SurvivingGraduateEconometricswithR:Difference-in-DifferencesEstimation2of8Thefollowi
3、ngreplicationexercisecloselyfollowsthehomeworkassignment#2inECNS562.Thedataforthisexercisecanbefoundhere.ThedataisabouttheexpansionoftheEarnedIncomeTaxCredit.Thisisalegislationaimedatprovidingataxbreakforlowincomeindividuals.Forsomebackgroundonthesubject,seeEissa,Nada,andJeffreyB.Liebman.1996.LaborS
4、upplyResponsestotheEarnedIncomeTaxCredit.QuarterlyJournalofEconomics.111(2):605-637.Thehomeworkquestions(abbreviated):Describeandsummarizedata.Calculatethesamplemeansofallvariablesfor(a)singlewomenwithnochildren,(b)singlewomenwith1child,and(c)singlewomenwith2+children.Createanewvariablewithearningsc
5、onditionalonworking(missingfornon-employed)andcalculatethemeansofthisbygroupaswell.Constructavariableforthe“treatment”calledANYKIDSandavariableforaftertheexpansion(calledPOST93shouldbe1for1994andlater).Createagraphwhichplotsmeanannualemploymentratesbyyear(1991-1996)forsinglewomenwithchildren(treatme
6、nt)andwithoutchildren(control).Calculatetheunconditionaldifference-in-differenceestimatesoftheeffectofthe1993EITCexpansiononemploymentofsinglewomen.Nowrunaregressiontoestimatetheconditionaldifference-in-differenceestimateoftheeffectoftheEITC.Useallwomenwithchildrenasthetreatmentgroup.Reestimatethism
7、odelincludingdemographiccharacteristics.Addthestateunemploymentrateandallowitseffecttovarybythepresenceofchildren.Allowthetreatmenteffecttovarybythosewith1or2+children.Estimatea“placebo”treatmentmodel.Takedatafromonlythepre-reformperiod.Usethesametreatmentandcontrolgroups.Introduceaplacebopolicythat
8、beginsin1992(so1992and1993bothhavethisfakepolicy).Areview:LoadingyourdataRecallthecodeforimportingyourdata:STATA:/*Lastmodified1/11/2011*/*Thefollowingblockofcommandsgoatthestartofnearlyalldofiles*/*Bracketcommentswith/*/orjustuseanasteriskatlinebeginningclear/*Clearsmemory*/setmem50m/*Adjustthisfor
9、yourparticulardataset*/cdC:DATAEcon562homework/*Changethisforyourfilestructure*/logusing,replace/*Logfilerecordsallcommands&results*/display$S_DATE$S_TIMEsetmoreoffinsheetusing,clearR:#KevinGoulding#ECNS562-Assignment2#Loadtheforeignpackagerequire(foreign)#Importdatafromwebsite#update:firstdownloadt
10、hefilefromthislink:10#Thenimportfromyourharddrive:11eitc=(C:/link/to/my/download/folder/)12NotethatanycommentscanbeembeddedintoRcode,simplybyputtinga#totheleftofyourcom13fromyourharddrive:1415eitc=(C:DATACoursesEcon562homework)DescribeandsummarizeyourdataRecallfrompart1ofthisseries,thefollowingcodet
11、odescribeandsummarizeyourdata:STATA:dessumR:InR,eachcolumnofyourdataisassignedaclasswhichwilldeterminehowyourdataistreatedinvariousfunctions.ToseewhatclassRhasinterpretedforallyourvariables,runthefollowingcode:sapply(eitc,class)summary(eitc)source()sumstats(eitc)TooutputthesummarystatisticstabletoLa
12、TeX,usethefollowingcode:require(xtable)#xtablepackagehelpscreateLaTeXcodefromR.xtable(sumstats(eitc)Note:Youwillneedtore-runthecodeforsumstats()whichyoucanfindinanearlierpost.CalculateConditionalSampleMeansSTATA:summarizeifchildren=0summarizeifchildren=1summarizeifchildren=1summarizeifchildren=1&yea
13、r=1994meanworkifpost93=0&anykids=1R:#Thefollowingcodeutilizesthesumstatsfunction(youwillneedtore-runthiscode)TOC o 1-5 h zsumstats(eitceitc$children=0,)sumstats(eitceitc$children=1,)sumstats(eitceitc$children=1,)sumstats(eitceitc$children=1&eitc$year=1994,)#Alternately,youcanusethebuilt-insummaryfun
14、ctionsummary(eitceitc$children=0,)summary(eitceitc$children=1,)summary(eitceitc$children=1,)summary(eitceitc$children=1&eitc$year=1994,)#Anotherexample:Summarizevariableworkforwomenwithonechildfrom1993onwards.summary(subset(eitc,year=1993&children=1,select=work)Thecodeaboveincludesallsummarystatisti
15、cs一butsayyouareonlyinterestedinthemean.Youcouldthenbemorespecificinyourcoding,likethis:mean(eitceitc$children=0,work)mean(eitceitc$children=1,work)mean(eitceitc$children=1,work)Tryoutanyoftheotherheadingswithinthesummaryoutput,theyshouldalsowork:min()forminimumvalue,max()formaximumvalue,stdev()forst
16、andarddeviation,andothers.CreateaNewVariableTocreateanewvariablecalled“”equaltoearningsconditionalonworking(if“work”=1),“NA”otherwise(“work”=0)一usethefollowingcode:STATA:gencearn=earnifwork=1R:121234567z=names(eitc)X=lapply(X,function(x)replace(x,x=0,NA)eitc=cbind(eitc,X)eitc$=NULLnames(eitc)=zConst
17、ructaTreatmentVariableConstructavariableforthetreatmentcalled“anykids”=1fortreatedindividual(hasatleastonechild);andavariableforaftertheexpansioncalled“post93”=1for1994andlater.STATA:genanykids=(children=1)genpost93=(year=1994)R:1eitc$post93=(eitc$year=1994)2eitc$anykids=(eitc$children0)CreateaplotC
18、reateagraphwhichplotsmeanannualemploymentratesbyyear(1991-1996)forsinglewomenwithchildren(treatment)andwithoutchildren(control).STATA:preservecollapsework,by(yearanykids)genwork0=workifanykids=0labelvarwork0Singlewomen,nochildrengenwork1=workifanykids=1labelvarwork1Singlewomen,childrentwoway(linewor
19、k0year,sort)(linework1year,sort),ytitle(LaborForceParticipationRates)graphsaveGraphhomework,replaceR:#Takeaveragevalueofworkbyyear,conditionalonanykidsminfo=aggregate(eitc$work,list(eitc$year,eitc$anykids=1),mean)#renamecolumnheadings(variables)names(minfo)=c(YR,Treatment,LFPR)#Attachanewcolumnwithl
20、abelsminfo$Group1:6=Singlewomen,nochildrenminfo$Group7:12=Singlewomen,childrenminforequire(ggplot2)#packageforcreatingniceplotsqplot(YR,LFPR,data=minfo,geom=c(point,line),colour=Group,xlab=Year,ylab=LaborForceParticipationRate)+-_/-tffI备l=2)genpostXone=post93*onekidgenpostXtwo=post93*twokidR:#Thesta
21、teunemploymentrateinteractedwithnumberofchildreneitc$=eitc$urate*eitc$anykids#Creatinganewtreatmentterm:#First,wellcreateanewdummyvariabletodistinguishbetweenonechildand2+.eitc$manykids=(eitc$children=2)#Next,wellcreateanewvariablebyinteractingthenewdummy#variablewiththeoriginalinteractionterm.eitc$tr2=eitc$*eitc$manykidsEstimateaPlaceboMod
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年智能电网储能系统工程师供应链优化
- 刨花干燥工岗中适应能力考核试卷含答案
- 铸造工岗位水平考核试卷含答案
- 水产蛋白提炼工技能安全竞赛考核试卷含答案
- 采输气仪表工岗位模拟考核试卷含答案
- 2026年显示智能化高级专家招聘笔试试卷 招录12人考试题库
- 2026年数字视觉高级研发师招聘笔试试卷 招录12人通关秘籍题库
- 2026年四川省江油市高三数学下册期末考试模拟考试卷(综合题)附答案
- 2026年云南省弥勒市高三数学下册期末考试模拟检测卷及完整答案【名师系列】
- (附表二)公司存档监理资料目录
- 孕产妇脓毒症的高危因素与早期识别
- 智慧工地项目数据台账管理手册
- 电子档案和档案数字化副本移交接收规范
- 围手术期高血糖患者营养支持治疗管理专家共识(2025版)
- 《成人住院患者跌倒风险评估及预防》(T-CNAS 09-2020)团体标准解读与临床实施规范
- 2025中华护理学会团体标准-成人吞咽障碍患者口服给药护理
- 2026年江苏消防文员考试试题及答案
- 临床科学防治颈椎病守护颈部健康关键策略
- 沉浸式了解博物馆发展历程
- 外墙线条维修施工方案(3篇)
- 信托业务监管分类说明(试行)
评论
0/150
提交评论