¹ãÒåÇãÏòµÃ·ÖÆ¥Åä·¨£ºStata³ÌÐò+ʵÀýÂÛÎÄ - ͼÎÄ ÏÂÔØ±¾ÎÄ

358EstimatingtheGPSandthedose¨Cresponsefunction

b.WithineachtreatmentintervalGk,k=1,...,K,computetheGPSatauser-speci?edrepresentativepoint(e.g.,themean,themedian,oranotherpercentile)ofthetreatmentvariable,whichwedenotebytGk,foreachunit.Letr(tGk,Xi)bethevalueoftheGPScomputedattGk¡ÊGkforuniti.c.Foreachk,k=1,...,K,blockonthescoresr(tGk,Xi),usingmintervals,de?nedbythequantilesoforderj/m,j=1,...,m?1,oftheGPSevalu-(k)(k)

atedattGk,r(tGk,Xi),i=1,...,N.LetB1,...,BmdenotethemGPSintervalsforthekthtreatmentinterval,Gk.d.WithineachintervalBj,j=1,...,m,calculatethemeandi?erenceofeachcovariatebetweenunitsthatbelongtothetreatmentinterval,Gk,{i:Ti¡Ê

(k)

Gk},andunitsthatareinthesameGPSinterval,{i:r(tGk,Xi)¡ÊBj},but

/Gk}.belongtoanothertreatmentinterval,{i:Ti¡Êe.Combinethemdi?erencesinmeans,calculatedinstepd,byusingaweighted

average,withweightsgivenbythenumberofobservationsineachGPSin-(k)

tervalBj,j=1,...,m.Speci?cally,thefollowingweightedaverageiscalculatedforeachofthepcovariatesXl,l=1,...,p:

m1??

NB(k){xl,j(Gk)?xl,j(Gck)}jNj=1(k)

whereNB(k)isthenumberofobservationsintheBj

j

(k)

GPS

interval;xl,j(Gk)

(k)

isthemeanofthecovariateXlforunitsi,suchthatr(tGk,Xi)¡ÊBjand

??

Ti¡ÊGk;andxl,j(Gck)isthemeanofthecovariateXlforunitsi,suchthat

(k)

/Gk.Theteststatisticsweusetoevaluatether(tGk,Xi??)¡ÊBjandTi??¡Ê

balancingpropertyarefunctionsofthisweightedaverage.

f.ForeachGk,k=1,...,K,teststatistics(theStudent¡¯ststatisticsortheBayesfactors)arecalculatedandshownintheResultswindow.Finally,themostextremevalueoftheteststatistics(thehighestabsolutevalueoftheStudent¡¯ststatisticsorthelowestvalueoftheBayesfactors)iscomparedwithreferencevalues,andtheuserisinformedoftheextenttowhichthebalancingpropertyissupportedbythedata.

3.2

EstimatingtheconditionalexpectationoftheoutcomegiventhetreatmentandGPS

Inthesecondstage,wemodeltheconditionalexpectationoftheoutcome,Yi,givenTiandRi,asa?exiblefunctionofitstwoarguments.Weusepolynomialapproximationsofordernothigherthanthree.Speci?cally,themostcomplexmodelweconsideris

?{E(Yi|Ti,Ri)}=¦×(Ti,Ri;¦Á)

23+¦Á6¡¤Ri+¦Á7¡¤Ti¡¤Ri=¦Á0+¦Á1¡¤Ti+¦Á2¡¤Ti2+¦Á3¡¤Ti3+¦Á4¡¤Ri+¦Á5¡¤Ri

M.BiaandA.Mattei359

where?(¡¤)isalinkfunctionthatrelatesthepredictor,¦×(Ti,Ri;¦Á),totheconditionalexpectation,E(Yi|Ti,Ri).

Weassumethatthemaine?ectsofTiandRicannotberemovedsothatwehave18possiblesubmodels.Theprogramdoseresponsemodel.adode?nesallthesemodels

??i.When?ttingtheselectedandestimateseachofthembyusingtheestimatedGPS,R

model,theprogramtakesintoaccountthenatureoftheoutcomevariable¡ªwhichmaybebinary,categorical(nominalorordinal),orcontinuous¡ªbychoosingtheappropriatelinkfunction.

AsHiranoandImbens(2004)emphasize,thereisnodirectmeaningtotheestimatedcoe?cientsintheselectedmodel,exceptthattestingwhetherallcoe?cientsinvolvingtheGPSareequaltozerocanbeinterpretedasatestofwhetherthecovariatesintroduceanybias.

3.3Estimatingthedose¨Cresponsefunction

Thelaststepconsistsofaveragingtheestimatedregressionfunctionoverthescorefunctionevaluatedatthedesiredlevelofthetreatment.Speci?cally,inordertoobtainanestimateoftheentiredose¨Cresponsefunction,weestimatetheaveragepotentialoutcomeforeachlevelofthetreatmentweareinterestedinas

NN??1????1???1??????E{Y(t)}=???}¦Â{t,r??(t,Xi)}=¦×{t,r??(t,Xi);¦ÁNi=1Ni=1

where¦Á??isthevectoroftheestimatedparametersinthesecondstage.

Theprogramdoseresponse.adoestimatesthedose¨Cresponsefunctionaccordingto

thefollowingalgorithm:

1.EstimatetheGPS,verifythenormalmodelusedfortheGPS,andtestthebalancingpropertycallingtheroutinegpscore.ado.2.Estimatetheconditionalexpectationoftheoutcome,giventhetreatmentandtheGPS,bycallingtheroutinedoseresponsemodel.ado.3.Estimatetheaveragepotentialoutcomeforeachlevelofthetreatmenttheuserisinterestedin.4.Estimatestandarderrorsofthedose¨Cresponsefunctionviabootstrapping.25.Plottheestimateddose¨Cresponsefunctionand,ifrequested,itscon?denceinter-vals.

2.HiranoandImbens(2004)statethatasymptoticstandarderrorsoftheestimateddose¨Cresponsefunctioncouldbecalculatedbyusingexpansionsbasedontheestimatingequations;theseshouldtakeintoaccounttheestimationoftheGPSaswellasthe¦Áparameters.Forpracticalreasons,ourprogramusesbootstrapmethodstoobtainstandarderrorsandcon?denceintervalsofthedose¨CresponsefunctionthattakeintoaccountestimationoftheGPSandthe¦Áparameters.

360EstimatingtheGPSandthedose¨Cresponsefunction

Someremarksonstep4ofthealgorithmcanbeuseful.Whenbootstrappedstandarderrorsarerequested,byactivatingtheappropriateoption(seesections4and5),thebootstrapencompassesboththeestimationoftheGPSbasedonthespeci?cationgivenbytheuserandtheestimationofthe¦Áparameters.ReestimatingtheGPSandthe¦ÁparametersateachreplicationofthebootstrapprocedureallowsustoaccountfortheuncertaintyassociatedwiththeestimationoftheGPSandthe¦Áparameters.

Typically,userswould?rstidentifyatransformationofthetreatmentvariableandaspeci?cationofthefunctionhin(1),satisfyingthenormalityassumptionandthebalancingproperty,respectively(byusing,forinstance,theroutinegpscore.ado),andthenprovideexactlythistransformationandthisspeci?cationintheinputtothepro-gramdoseresponse.ado.

4Syntax

??if????

in????

??

weight,t(varname)gpscore(newvar)

predict(newvar)sigma(newvar)cutpoints(varname)index(string)

??

nqgps(#)ttransf(transformation)normaltest(test)normlevel(#)

??

testvarlist(varlist)test(type)flag(#)detailgpscorevarlist

????????????

inweight,outcome(varname)doseresponsemodeltreatvarGPSvarif

??

cmd(regressioncmd)regtypet(string)regtypegps(type)

??

interaction(#)doseresponsevarlist

??if????

in????

??

weight,outcome(varname)t(varname)

gpscore(newvar)predict(newvar)sigma(newvar)cutpoints(varname)index(string)nqgps(#)doseresponse(newvarlist)??

ttransf(transformation)normaltest(test)normlevel(#)testvarlist(varlist)test(type)flag(#)cmd(regressioncmd)regtypet(type)regtypegps(type)interaction(#)tpoints(vector)npoints(#)delta(#)filename(?lename)bootstrap(string)bootreps(#)

??

analysis(string)analysislevel(#)graph(?lename)detailInthegpscoreanddoseresponsecommands,theargumentvarlistrepresentsthelistofcontrolvariables,whichareusedtoestimatetheGPS.Inthedoseresponsemodelcommand,thevariablelistconsistsofonlytwovariables:thetreatmentvariable(treatvar)andtheGPS(GPSvar).

M.BiaandA.Mattei361

5Options

Wedescribeonlytheoptionsforthedoseresponsecommand,becausetheyincludealltheoptionsforthegpscorecommandandthedoseresponsemodelcommand.There-fore,alltheoptionsdescribedinsections5.1and5.2applytodoseresponse,andwespecify,ifapplicable,whethertheoptionalsoappliestogpscoreordoseresponsemodel.

5.1Required

outcome(varname)(doseresponsemodel)speci?esthatvarnameistheoutcomevari-able.t(varname)(gpscore)speci?esthatvarnameisthetreatmentvariable.gpscore(newvar)(gpscore)speci?esthevariablenamefortheestimatedGPS.predict(newvar)(gpscore)createsanewvariabletoholdthe?ttedvaluesofthetreatmentvariable.sigma(newvar)(gpscore)createsanewvariabletoholdthemaximumlikelihoodesti-mateoftheconditionalstandarderrorofthetreatmentgiventhecovariates.cutpoints(varname)(gpscore)dividesthesetofpotentialtreatmentvalues,T,intointervalsaccordingtothesampledistributionofthetreatmentvariable,cuttingatvarnamequantiles.index(string)(gpscore)speci?estherepresentativepointofthetreatmentvariableatwhichtheGPShastobeevaluatedwithineachtreatmentinterval.stringidenti-?eseitherthemean(string=mean)orapercentile(string=p1,...,p100)ofthetreatment.nqgps(#)(gpscore)speci?esthatthevaluesoftheGPSevaluatedattherepresen-tativepointindex(string)ofeachtreatmentintervalhavetobedividedinto#(#¡Ê{1,...,100})intervals,de?nedbythequantilesoftheGPSevaluatedattherepresentativepointindex(string).doseresponse(newvarlist)speci?esthevariablename(s)fortheestimateddose¨Cresponsefunction(s).

(Continuedonnextpage)