Statalist


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

Re: st: Plotting a Local Polynomial Regression with CIs Accounting for Clustering


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Plotting a Local Polynomial Regression with CIs Accounting for Clustering
Date   Sat, 28 Nov 2009 02:46:50 -0800 (PST)

--- On Sat, 28/11/09, L S <[email protected]> wrote:
> I would like to graph a nonparametric regression of y on
> x.  The graph should include 95% confidence intervals for
> the nonparametric regression which account for clustering
> of the errors over each individual in the data 

What about (you can add more graphs to this plot using the
-addplot()- option):

*----------------- begin example -----------------
clear
set obs 100
set seed 1234
gen id = _n
gen e = uniform()
expand 5
gen x = uniform()
gen y = -.6 + 1.4*x^.5 + .5*(x>.5) + e
fracpoly reg y x, cluster(id)
fracplot
*------------------ end example ------------------

Hope this helps,
Maarten

--------------------------
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index