Date: Wed, 21 Mar 2007 07:04:05 -0400 Peter Flom "SAS(r) Discussion" Peter Flom Re: Conditional clauses in a regression model text/plain; charset=UTF-8

--- Jean-Jacques Dubois <jjbdubois@MINDSPRING.COM> wrote:

> Hello all, > > I have to work with yet another awful regression model, made up of > two > intersecting hyperbolas, which can be fitted using at least two PROCs > (NLIN > and MODEL), using conditional syntax. In PROC NLIN, it looks > something like > this: > > proc NLIN data=a method=Marquardt; > Y1= a*x/ x ; > Y2= b*x/ x ; > parameters a=5 to 50 by 5 > b=5 to 50 by 5 > c=0 to 5 by 1; > > if Y1<Y2 then model=Y1-c; > else model=Y2-c; > run; > > an equivalent would be: > > â€|model=min(Y1,Y2)-c; > > This does not work out too badly with the data of interest, but users > are very curious to know just how SAS handles the fitting of this type of > so-called â€̃segmentedâ€™ model. I am not quite sure what they mean, > but I think they would like more detail of how the objective function is > computed, then minimized, when conditional clauses are involved. > I know I would like to know. > I have not had much success in the literature, and I hope one of you > will be able to shed some light.

Dale responded <<< David Cassell has not yet found time to respond to your question, so let me play the curmudgeon role here tonight. So, before answering your question, I have a number of questions for you to address.

1) How are the data presented to you? Do you have just a single response variable Y that theory indicates should have two different functional relationships with a predictor X depending on whether the predictor has X>=X_join?

2) Why do you have only a single intercept term in your model? Unless you know that the two segments should join at X=0, then you really should have two intercepts in your model, shouldn't you?

3) Also, I would note that the code you present above has no response variable named, so the above code cannot be code that you have used to fit a model. Without really knowing what code you have fit, it is not really possible to say what your estimation model is doing?

4) Finally, if you don't know how the model is being fit, then how do you know that you are fitting an appropriate model in the first place? It seems rather odd to me to write, in essence, "This is my model, now tell me what it does."

Sorry to be so terse here, but your post raises a lot of questions and red flags to me. >>>>

For me, too.

I was wondering what process would require such a fit, and why not fit it with restricted cubic splines in PROC TRANSREG.

Peter

Back to: Top of message | Previous page | Main SAS-L page