Statalist


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

Re: st: combine two graphs of kernel local polynomial


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: combine two graphs of kernel local polynomial
Date   Fri, 6 Feb 2009 19:07:04 +0000 (GMT)

--- On Fri, 6/2/09, Ana Gabriela Guerrero Serdan wrote:
> I want to do a graph of two kernel local polynomial
> smoothing regressions. 

*-------------- begin example -------------
sysuse auto, clear

lpoly price mpg if foreign == 1, ///
      nograph gen(sfor) at(mpg) se(sefor)
gen lbfor = sfor - invnormal(.975)*sefor
gen ubfor = sfor + invnormal(.975)*sefor

lpoly price mpg if foreign == 0, ///
      nograph gen(sdom) at(mpg) se(sedom)
gen lbdom = sdom - invnormal(.975)*sedom
gen ubdom = sdom + invnormal(.975)*sedom

sort mpg
twoway rarea lbfor ubfor mpg || ///
       rarea lbdom ubdom mpg || ///
       line sfor mpg         || ///
       line sdom mpg
*-------------- end example ------------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room N515

+31 20 5986715

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/



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