Bookmark and Share

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]

st: -nl- with fixed effects


From   "George Davies" <[email protected]>
To   [email protected]
Subject   st: -nl- with fixed effects
Date   Tue, 02 Jul 2013 14:58:14 +0200

Dear all,  

I am trying to perform a nonlinear squares estimation to determine the optimal cut-point in a piecewise regression, and having a few problems.  There have been a few similar questions in the past, which I've read through, but I'm still having one or two issues.  I'd be very grateful if anyone had any ideas.  

I have panel data for 15 countries over 30 years.  I know the cut-point is somewhere around zero, and running a piecewise/segmented regression with country- and year-fixed effects and a knot at 0 gets me good results.  But I'd like to be more precise in finding the best cut-point.  Dropping the fixed effects, I have used the -nl- command to determine an optimal cut point (-.47) - see code below - but I'm not sure how to code in the fixed effects.  Has anyone here managed anything similar in their work? There would be 33 fixed effects (14 + 29)... is that too many for such an estimation to handle? If not, how might you go about coding them into the equation below? 

I'm afraid I'm a bit of a beginner at this, so any help would be greatly appreciated! 

Many thanks indeed,  

George 

************************* 

nl (y = ({a1} + {b1}*x)*(x < {c}) + ({a1} + {b1}*{c} + {b2}*(x-{c}))*(x >= {c})), initial(a1 3 b1 0.04 c 0 b2 0.01) 

************************* 

I am using Stata 12 for Mac. 
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index