Dear listers,
I have searched the manual and dug through the list but have come up empty. So apologies if this is either easy or obvious.
Here is the problem. I am estimating a model using bootstrap resampling. After estimation I want to graph the marginal effect and the bias-corrected confidence interval across values of my variable of interest, diff, in the model below
Here is the code
capture program drop strap
program strap, rclass
**Step 1: Estimate difference
reg lnsmooth i.year##c.(lndist contig smct comlang_off colony) L10.joint_migration lntotalpop,
predict yhat2
reg lnsmooth i.year##c.(lndist contig smct comlang_off colony) lntotalpop,
predict yhat1
gen diff=yhat2-yhat1
**diff is my variable of interest
areg prio l.(jointdem2 capratio1 joint_migration diff lntotalpop ideal_diff lngdp_diff ) if politically_relevant==1 , abs(dyadnum)
drop diff yhat1 yhat2
exit
end
gen newdyad=dyadnum
tsset newdyad year
#delimit ;
bootstrap coeff=
r(PPdiff) , reps(25) seed(12345) cluster(dyadnum) idcluster(newdyad) nodrop:strap saving(ci,replace) ;
#delimit cr
estat bootstrap
**********************************************
estat gives me the estimated coefficient of diff and the bias corrected standard error. What I want to do now is graph the estimate (yes, it is linear) and the confidence (which is not) across values of diff. Everything I have tried has failed. Any ideas?
Thanks,
David
Related Posts with Plotting marginal effects, confidence intervals after bootstrap
displaying the contents of a macroHi all: I am using "macro list" to display the contents of all the macros I have created (locals and…
generate variable time to event. Several measures in time.Please, I need to create a variable event and time to event. But I have different measures. The vari…
Bug fix for estimates table and estout/esttab in Feb 20 update of Stata 15In the latest update of Stata 15 (from Feb 20, 2019), models with ancillary parameters can cause pro…
Is it possible to destring a variable which starts with a letter?Hello, I am using Parliamentary Constituency codes (variable name _pcon) in my dataset which begin w…
Frequency bar graph for multiple binary variablesI have a string variable (Reasons_Inadmissible) with multiple values that are comma separated. It li…
Subscribe to:
Post Comments (Atom)
0 Response to Plotting marginal effects, confidence intervals after bootstrap
Post a Comment