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: can cond() be nested (within nl)?
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: can cond() be nested (within nl)?
Date
Mon, 3 Dec 2012 10:39:05 +0000
It is perfectly legal to include -cond()- within the <sexp> in
nl (depvar=<sexp>) [if] [in] [weight] [, options]
if that is what you mean. But -mkspline- followed by -regress- sounds
much easier here.
On Mon, Dec 3, 2012 at 9:59 AM, David Raitzer <[email protected]> wrote:
I am trying to do a segmented linear regression with the nl function
and cond. The intention is to have two breakpoints and 3 segments,
which means that 3 conditions are required. Can cond be nested
within nl to apply more than 2 conditions? If not, what is the best
way to approach such a regression when the segmentation depends upon 3
ranges of an x, rather than only 2? Thanks!
*
* 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/