Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Marginal effects plot for tobit with interaction term
From
Jan Duchoslav <[email protected]>
To
[email protected]
Subject
st: Marginal effects plot for tobit with interaction term
Date
Sat, 27 Apr 2013 12:33:00 +0200
Dear all,
I use the marginal effect plots for a model with and interaction term
as suggested by Berry, Golder and Milton. 2012. "Improving Tests of
Theories Positing Interaction." The Journal of Politics 74(3):
653-671. Please find the code (largely based on that provided by
Golder at https://files.nyu.edu/mrg217/public/interaction.html) below:
tobit cash_pc treat scchiefbl inter scvillbl pop, ll(0) level(95)
matrix b=e(b)
matrix V=e(V)
scalar b1=b[1,1]
scalar b2=b[1,2]
scalar b3=b[1,3]
scalar varb1=V[1,1]
scalar varb2=V[2,2]
scalar varb3=V[3,3]
scalar covb1b3=V[1,3]
scalar covb2b3=V[2,3]
scalar list b1 b2 b3 varb1 varb2 varb3 covb1b3 covb2b3
drop vill_id-scvillbl scvill-inter
set obs 10000
generate MVZ=((_n+680)/1000)
replace MVZ = . if MVZ > 1
replace MVZ = . if MVZ < 0.68
drop if MVZ == .
gen conbx=b1+b3*MVZ
label var conbx "ME estimate"
gen consx=sqrt(varb1+varb3*(MVZ^2)+2*covb1b3*MVZ)
gen ax95=2.03*consx
gen ax90=1.69*consx
gen upperx95=conbx+ax95
label var upperx95 "95% conf. level"
gen upperx90=conbx+ax90
label var upperx90 "90% conf. level"
twoway (line conbx MVZ, lc(black) yaxis(1)) ///
(line upperx90 MVZ, lc(black) lpat("-") yaxis(1)) ///
(line upperx95 MVZ, lc(black) lpat(".-") yaxis(1))
Since I use a tobit model, I would like to construct similar plots for
marginal effects conditional on being uncensored and for marginal
effects on the probability of being uncensored. I get the marginal
effects on each term using the -dtobit- command (from STB-56: sg144,
updated sg144_1), which runs a Moffitt-McDonald decomposition. This
has to be done in version 8 as starting with version 9, Stata uses a
different way to store estimation results (or so I understand):
version 8: tobit cash_pc treat scchiefbl inter scvillbl pop, ll(0) level(95)
dtobit
Now my question is: Does anybody know if and how -dtobit- stores its
results so that they can be used to construct the plots in a similar
way as above? I would appreciate any leads.
Thanks for your consideration,
Jan
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/