Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: broken stick (piecewise linear) regression

From   keith Farnsworth <>
Subject   Re: st: RE: broken stick (piecewise linear) regression
Date   Tue, 24 May 2005 14:32:07 +0100

Thanks for your helpful suggestions Maarten,

Actually my main concern *is* with finding the location of the one knot. I could provide a guess to start things off, but need to know the best fit location.

I am not interested in any old flexible line, the model is following a theoretical constraint - it has to be two straight lines. Where they intersect is an important parameter which we will then (having estimated it) feed into another model. As I understand it mkspline does not handle such a problem, but your use of nl may do.

On Tuesday, May 24, 2005, at 13:36 Europe/Dublin, Maarten Buis wrote:

Dear Keith
My post would do what you want, but normal spline regression is far far far more stable. So Nick was right (as usual) in pointing you to -mkspline-. I would only use -nl- if the location of the knot were my primary interest. I would still prefer to use somewhat plausible locations (like equally spaced knots) rather than -nl-, even if I did not know the exact location, if the exact locations of the knots are not of substantial interest (as is usually the case). If you just want to fit a flexible line through your data you could have a look at -locpoly-.
Hope this helps,
*   For searches and help try:

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