Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: How to plot a mkspline regression?


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to plot a mkspline regression?
Date   Thu, 11 Feb 2010 08:40:47 +0000 (GMT)

I answered your question using the newer -margins- command, but
it is easier to use the older -adjust- command (or I am not 
familiar enough with -margins- to have found the appropriate
trick):

*-------------------- begin example -----------------------
sysuse auto, clear
mkspline mpg1 20 mpg2 = mpg
reg price mpg? foreign rep78

adjust foreign=0 rep78=3, by(mpg) gen(yhat)
twoway line yhat mpg, sort ///
title(predicted price for US cars with average repair status)
*----------------------- end example ------------------------
( For more on how to use examples I sent to statalist see:
  http://www.maartenbuis.nl/stata/exampleFAQ.html )

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index