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
Storing values of a multivariate regressionHi Statalist! I have a panel data set with multiple variables (X1, X2, ...). I am trying to run a m…
Duplicates list full pieces of observationsHi Statalisters, Just have a simple question. If my dataset contains variable v1, v2, and v3, I use…
[HELP] Destring Variables DilemaHello Statalist -- Hope everyone is doing well. I am currently cleaning a dataset and am stumbling …
I want to run a VAR with bootstrap standard errorsI want to run a VAR(1) with both OLS standard errors and bootstrap standard errors which are compute…
Guidance on Multilevel ModelingHello everyone, I am working towards building a statistical model that predicts basic income prefer…
Subscribe to:
Post Comments (Atom)
0 Response to Plotting marginal effects, confidence intervals after bootstrap
Post a Comment