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
How to use "if not" condition in regressionHi all, I read the syntax of regress and operators but still cannot find how to run a regression wi…
Survival Analysis: Problem with setting up time to event data (years vs periods of time)Dear Statalist users, I am setting up a survival model, where I look at the farmers' time to adopti…
Merging Cross-sections of a Panel Data SetHello everyone, This is my first post on the forum, so I hope that I will be able to provide all th…
FGLS for panel dataI have a panel data N=46, T=4, with time invariant variable. Hausman test tells me I should do fixed…
Creating a mean for each person ID conditional on another variableHello, I have a long dataset with multiple observations of a value (value) per person id (pid). I h…
Subscribe to:
Post Comments (Atom)
0 Response to Plotting marginal effects, confidence intervals after bootstrap
Post a Comment