Hi everyone,
I want to run a boostapping procedure for a control function approach to check the robustness of my results. For this I first regress two instruments on my independent variable. I then want to predict the residuals from this procedure and use it in my second stage regression. Full code below.
My issue: I use random effects for the stage regression as one of the instruments is time-invariant. However, for -xtreg,re- I cannot do use -fweight- as intended.
It has been quite a while since I posted, hope I could clarify my issue. If not, please let me know.
Thanks - looking forward to your replies.
I want to run a boostapping procedure for a control function approach to check the robustness of my results. For this I first regress two instruments on my independent variable. I then want to predict the residuals from this procedure and use it in my second stage regression. Full code below.
My issue: I use random effects for the stage regression as one of the instruments is time-invariant. However, for -xtreg,re- I cannot do use -fweight- as intended.
weight not allowed with between-effects and random-effects modelsI have tried using -xtreg, mle- as per this thread, however, my code then does not allow to predict the residuals anymore, which is essential for what I want to achieve.
r(101)
option res not allowedAre there any alternative solution approaches that you could recommend?
r(198)
It has been quite a while since I posted, hope I could clarify my issue. If not, please let me know.
Thanks - looking forward to your replies.
Code:
save DataBS_PAT.dta, replace set seed 1 capture postclose bs postfile bs repl ExtFounderCEO res using bs, replace forvalues repl = 1/1000 { noi dis "repl: " `repl' clear use "DataBS_PAT.dta" sort Gvkey Year xtset Gvkey Year gen bsweight = . bsample, cluster(Gvkey) weight(bsweight) xtreg ExtFounderCEO ShareExtFounderCEOIndPeers2 KM_EmployerBusinessNewness IntFounderCEO IndustryPerformance IndustryHHI FirmTobQ FirmSize FirmRD3 CEOAge CEOTenure CEOEdu CEOTecDeg CEOPower i.Year [fweight = bsweight], re capture drop res predict res, res xtpoisson f.pat_filings ExtFounderCEO IntFounderCEO IndustryPerformance IndustryHHI FirmTobQ FirmSize FirmRD3 CEOAge CEOTenure CEOEdu CEOTecDeg CEOPower i.Year res, fe vce(robust) post bs (`repl') (_b[ExtFounderCEO]) (_b[res]) } postclose bs1
Comment