--- On Wed, 17/6/09, [email protected] wrote:
> I included 6 interaction terms in my regression. Two were
> significant so I would like to graph them. This is an
> example for the graph I would like to generate
> http://en.wikipedia.org/wiki/File:Interaction_effect.gif
*-------------- begin example ----------------------------
sysuse auto, clear
replace price = price/1000
recode rep78 (1/3=0) (4/5=1)
gen repXfor = rep78*foreign
reg price rep78 foreign repXfor mpg
adjust mpg, by(rep78 foreign) gen(pricehat)
twoway line pricehat rep78 if foreign == 0, sort || ///
line pricehat rep78 if foreign == 1, sort ///
legend(order(1 "domestic" 2 "foreign")) ///
ytitle(predicted price)
*--------------- end example ----------------------------
Hope this helps,
Maarten
-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
*
* 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/