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]
Re: st: Polynomial Fitting and RD Design
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: Polynomial Fitting and RD Design
Date
Thu, 1 Sep 2011 10:06:59 +0200
--- On Wed, Aug 31, 2011 at 9:54 PM, Patrick Button wrote:
>>> I need to run a regression that fits a 4th degree polynomial separately
>>> for points of the running variable, x, below 0.5 and above 0.5. The
>>> regression includes a dummy variable for if x >= 0.5 or not as well. If
>>> there is a discontinuity at 0.5, then this is picked up in the coefficient
>>> on that dummy variable.
<snip>
>>> *Left Side Polynomial
>>> gen xa = (1-D)*x
>>> gen x2a = (1-D)*x^2
<snip>
--- On Thu, Sep 1, 2011 at 8:37 AM, Nick Cox wrote:
> Even if you can get this to work as intended, look at the sizes of
> those coefficients! The resultant curve may look about right, but this
> is a dubious thing to do numerically and statistically. I
The numerical problems can be alleviated by using orthogonal
polynomials, see -help orthog-. This is just a different way of
representing that 4th degree polynomial that makes it a lot easier for
computers to deal with.
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/