安慰劑檢驗介紹、操作及舉例_第1頁
安慰劑檢驗介紹、操作及舉例_第2頁
安慰劑檢驗介紹、操作及舉例_第3頁
安慰劑檢驗介紹、操作及舉例_第4頁
安慰劑檢驗介紹、操作及舉例_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

安慰劑檢驗介紹(Placebotest)安慰劑是一種附加實證檢驗的思路,并不存在一個具體的特定的操作方法。一般存在兩種尋找安慰劑變量的方法。比如,在已有的實證檢驗中,發(fā)現(xiàn)自變量Xi會影響自變量Zi與因變量Yi之間存在相關關系。在其后的實證檢驗中,采用其他主體(國家,省份,公司)的Xj變量作為安慰劑變量,檢驗Xj是否影響Zi與Yi之間的相關關系。如果不存在類似于Xi的影響,即可排除Xi的安慰劑效應,使得結果更為穩(wěn)健。另一種尋找安慰劑變量的方法。已知,Xi是虛擬變量,Xi=1,ift>T;Xi=0ift<T;Xi對Zi對Yi的影響的影響在T時前后有顯著差異(DID)。在其后的實證檢驗中,將Xi`設定為Xi`=1,ift>T+n;Xi`=0ift<T+n,其中n根據(jù)實際情況取值,可正可負。檢驗Xi`是否影響Zi與Yi之間的相關關系。如果不存在類似于Xi的影響,即可排除Xi的安慰劑效應,使得結果更為穩(wěn)健。舉例:以美國市場某種政策沖擊識別策略的因果關系考察,在最后部分選取英國同期的因變量,檢驗是否有類似的特征,就是安慰劑檢驗。以中國2007年所得稅改革作為減稅的政策沖擊以驗證減稅對企業(yè)創(chuàng)新的影響。亦可以通過把虛擬的政策實施時間往前往后推幾年,作為虛擬的政策時點,如果檢驗發(fā)現(xiàn)沒有類似的因果,文章的主要結論就更加可信了。以下是詳細的例題,安慰劑檢驗在最后。Thefollowingreplicationexercisecloselyfollowsthehomeworkassignment#2inECNS562.Thedataforthisexercisecanbefound

\o"eitc.dta"here.ThedataisabouttheexpansionoftheEarnedIncomeTaxCredit.Thisisalegislationaimedatprovidingataxbreakforlowincomeindividuals.

Forsomebackgroundonthesubject,seeEissa,Nada,andJeffreyB.Liebman.1996.LaborSupplyResponsestotheEarnedIncomeTaxCredit.QuarterlyJournalofEconomics.

111(2):605-637.Describeandsummarizedata.Calculatethesamplemeansofallvariablesfor(a)singlewomenwithnochildren,(b)singlewomenwith1child,and(c)singlewomenwith2+children.Createanewvariablewithearningsconditionalonworking(missingfornon-employed)andcalculatethemeansofthisbygroupaswell.Constructavariableforthe“treatment”calledANYKIDSandavariableforaftertheexpansion(calledPOST93—shouldbe1for1994andlater).Createagraphwhichplotsmeanannualemploymentratesbyyear(1991-1996)forsinglewomenwithchildren(treatment)andwithoutchildren(control).Calculatetheunconditionaldifference-in-differenceestimatesoftheeffectofthe1993EITCexpansiononemploymentofsinglewomen.Nowrunaregressiontoestimatetheconditionaldifference-in-differenceestimateoftheeffectoftheEITC.Useallwomenwithchildrenasthetreatmentgroup.Reestimatethismodelincludingdemographiccharacteristics.Addthestateunemploymentrateandallowitseffecttovarybythepresenceofchildren.Allowthetreatmenteffecttovarybythosewith1or2+children.

Estimatea“placebo”treatmentmodel.Takedatafromonlythepre-reformperiod.Usethesametreatmentandcontrolgroups.Introduceaplacebopolicythatbeginsin1992(so1992and1993bothhavethisfakepolicy).Recallthecodeforimportingyourdata:/*Lastmodified1/11/2011*/**************************************************************************Thefollowingblockofcommandsgoatthestartofnearlyalldofiles*/*Bracketcommentswith/**/orjustuseanasteriskatlinebeginningclear/*Clearsmemory*/setmem50m/*Adjustthisforyourparticulardataset*/cd"C:\DATA\Econ562\homework"/*Changethisforyourfilestructure*/logusingstata_assign2.log,replace/*Logfilerecordsallcommands&results*/display"$S_DATE$S_TIME"setmoreoffinsheetusingeitc.dta,clear*************************************************************************123456789101112131415#KevinGoulding#ECNS562-Assignment2

###########################################################################Loadtheforeignpackagerequire(foreign)

#Importdatafromwebsite#update:firstdownloadthefileeitc.dtafromthislink:#/open?id=0B0iAUHM7ljQ1cUZvRWxjUmpfVXM#Thenimportfromyourharddrive:eitc=read.dta("C:/link/to/my/download/folder/eitc.dta")</pre>NotethatanycommentscanbeembeddedintoRcode,simplybyputtinga<code>#</code>totheleftofyourcomments(e.g.anythingtotherightof<code>#</code>willbeignoredbyR).Alternately,youcandownloadthedatafile,andimportitfromyourharddrive:

eitc=read.dta("C:\DATA\Courses\Econ562\homework\eitc.dta")Recallfrompart1ofthisseries,thefollowingcodetodescribeandsummarizeyourdata:dessumInR,eachcolumnofyourdataisassignedaclasswhichwilldeterminehowyourdataistreatedinvariousfunctions.ToseewhatclassRhasinterpretedforallyourvariables,runthefollowingcode:1234sapply(eitc,class)summary(eitc)source('sumstats.r')sumstats(eitc)TooutputthesummarystatisticstabletoLaTeX,usethefollowingcode:12require(xtable)

#xtablepackagehelpscreateLaTeXcodefromR.xtable(sumstats(eitc))Note:Youwillneedtore-runthecodefor

sumstats()

whichyoucanfindinan

\o"SummaryStatisticsfunctioninR:

sumstats()"earlierpost.summarizeifchildren==0summarizeifchildren==1summarizeifchildren>=1summarizeifchildren>=1&year==1994meanworkifpost93==0&anykids==11234567891011121314#Thefollowingcodeutilizesthesumstatsfunction(youwillneedtore-runthiscode)sumstats(eitc[eitc$children==0,])sumstats(eitc[eitc$children==1,])sumstats(eitc[eitc$children>=1,])sumstats(eitc[eitc$children>=1&eitc$year==1994,])

#Alternately,youcanusethebuilt-insummaryfunctionsummary(eitc[eitc$children==0,])summary(eitc[eitc$children==1,])summary(eitc[eitc$children>=1,])summary(eitc[eitc$children>=1&eitc$year==1994,])

#Anotherexample:Summarizevariable'work'forwomenwithonechildfrom1993onwards.summary(subset(eitc,year>=1993&children==1,select=work))Thecodeaboveincludesallsummarystatistics–butsayyouareonlyinterestedinthemean.Youcouldthenbemorespecificinyourcoding,likethis:123mean(eitc[eitc$children==0,'work'])mean(eitc[eitc$children==1,'work'])mean(eitc[eitc$children>=1,'work'])Tryoutanyoftheotherheadingswithinthesummaryoutput,theyshouldalsowork:

min()

forminimumvalue,

max()

formaximumvalue,

stdev()

forstandarddeviation,andothers.Tocreateanewvariablecalled“c.earn”equaltoearningsconditionalonworking(if“work”=1),“NA”otherwise(“work”=0)–usethefollowingcode:gencearn=earnifwork==11234567eitc$c.earn=eitc$earn*eitc$workz=names(eitc)X=as.data.frame(eitc$c.earn)X[]=lapply(X,function(x){replace(x,x==0,NA)})eitc=cbind(eitc,X)eitc$c.earn=NULLnames(eitc)=zConstructavariableforthetreatmentcalled“anykids”=1fortreatedindividual(hasatleastonechild);andavariableforaftertheexpansioncalled“post93”=1for1994andlater.genanykids=(children>=1)genpost93=(year>=1994)12eitc$post93=as.numeric(eitc$year>=1994)eitc$anykids=as.numeric(eitc$children>0)Createagraphwhichplotsmeanannualemploymentratesbyyear(1991-1996)forsinglewomenwithchildren(treatment)andwithoutchildren(control).preservecollapsework,by(yearanykids)genwork0=workifanykids==0labelvarwork0"Singlewomen,nochildren"genwork1=workifanykids==1labelvarwork1"Singlewomen,children"twoway(linework0year,sort)(linework1year,sort),ytitle(LaborForceParticipationRates)graphsaveGraph"homework\eitc1.gph",replace123456789101112131415#Takeaveragevalueof'work'byyear,conditionalonanykidsminfo=aggregate(eitc$work,list(eitc$year,eitc$anykids==1),mean)

#renamecolumnheadings(variables)names(minfo)=c("YR","Treatment","LFPR")

#Attachanewcolumnwithlabelsminfo$Group[1:6]="Singlewomen,nochildren"minfo$Group[7:12]="Singlewomen,children"minfo

require(ggplot2)

#packageforcreatingniceplots

qplot(YR,LFPR,data=minfo,geom=c("point","line"),colour=Group,

xlab="Year",ylab="LaborForceParticipationRate")Theggplot2packageproducessomenicelookingcharts.Calculatetheunconditionaldifference-in-differenceestimatesoftheeffectofthe1993EITCexpansiononemploymentofsinglewomen.meanworkifpost93==0&anykids==0meanworkifpost93==0&anykids==1meanworkifpost93==1&anykids==0meanworkifpost93==1&anykids==112345a=colMeans(subset(eitc,post93==0&anykids==0,select=work))b=colMeans(subset(eitc,post93==0&anykids==1,select=work))c=colMeans(subset(eitc,post93==1&anykids==0,select=work))d=colMeans(subset(eitc,post93==1&anykids==1,select=work))(d-c)-(b-a)Nowwewillrunaregressiontoestimatetheconditionaldifference-in-differenceestimateoftheeffectoftheEarnedIncomeTaxCrediton“work”,usingallwomenwithchildrenasthetreatmentgroup.Theregressionequationisasfollows:Where

isthewhitenoiseerrorterm.geninteraction=post93*anykidsregworkpost93anykidsinteraction12reg1=lm(work~post93+anykids+post93*anykids,data=eitc)summary(reg1)Addingadditionalvariablesisamatterofincludingtheminyourcodedregressionequation,asfollows:genage2=age^2/*Createage-squaredvariable*/gennonlaborinc=finc-earn/*Non-laborincome*/regworkpost93anykidsinteractionnonwhiteageage2edfincnonlaborinc123reg2=lm(work~anykids+post93+post93*anykids+nonwhite

+age+I(age^2)+ed+finc+I(finc-earn),data=eitc)summary(reg2)Wewillcreatetwonewinteractionvariables:Thestateunemploymentrateinteractedwithnumberofchildren.Thetreatmentterminteractedwithindividualswithonechild,ormorethanonechild.geninteru=urate*anykidsgenonekid=(children==1)gentwokid=(children>=2)genpostXone=post93*onekidgenpostXtwo=post93*twokid123456789101112#Thestateunemploymentrateinteractedwithnumberofchildreneitc$=eitc$urate*eitc$anykids

###Creatinganewtreatmentterm:

#First,we'llcreateanewdummyvariabletodistinguishbetweenonechildand2+.eitc$manykids=as.numeric(eitc$children>=2)

#Next,we'llcreateanewvariablebyinteractingthenewdummy#variablewiththeoriginalinteractionterm.eitc$tr2=eitc$eraction*eitc$manykidsTestingaplacebomodeliswhenyouarbitrarilychooseatreatmenttimebeforeyouractualtreatmenttime,andtesttoseeifyougetasignificanttreatmenteffect.genplacebo=(year>=1992)genplaceboXany=anykids*placeboregworkanykidsplaceboplaceboXanyifyear<199

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論