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: graph on marginal effects and confidence intervals
From
Mirko <[email protected]>
To
[email protected]
Subject
st: graph on marginal effects and confidence intervals
Date
Mon, 5 Apr 2010 12:02:26 +0100
Dear all,
I would like to plot marginal effects (of interaction terms) with
their confidence interval.
Graphing marginal effects it is easy enough (although I am sure there
are more efficient ways of doing this by using -mat- or something like
that):
sysuse auto, clear
regress mpg i.foreign##c.weight i.rep78 headroom
margins, dydx(weight) over(foreign) post
gen x = _n in 1/3
gen mem = b[1,1] in 1
replace mem= b[1,2] in 2
twoway (rscatter mem mem x), xlabel(1(1)2) yline(0)
Confidence intervals could be add to that graph as bars by including
-(rcap up low x)- to the -twoway- command; where up and low are upper
and lower confidence intervals, respectively:
twoway (rcap up low x) (rscatter mem mem x), xlabel(1(1)2) yline(0)
The problem is how can I "capture" the confidence intervals from
-margins- and generate up and low variables?
Any suggestion would be greatly appreciated.
Best wishes,
Mirko
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/