Re: [R] Specify a correct formula in R for Piecewise Linear Functions?

2008-01-02 Thread Thomas Lumley
On Tue, 1 Jan 2008, Charles C. Berry wrote: On Tue, 1 Jan 2008, zhijie zhang wrote: Dear all, I have two variables, y and x. It seems that the relationship between them is Piecewise Linear Functions. The cutpoint is 20. That is, when x20, there is a linear relationship between y and x;

Re: [R] Specify a correct formula in R for Piecewise Linear Functions?

2008-01-02 Thread Charles C. Berry
On Thu, 3 Jan 2008, zhijie zhang wrote: Some developments with confusions. I tried the spline method and dummy variable approach to do it. But their results are very different. See following. [volumes of output and gratuitous SAS code deleted] Q1: Why are these two methods so different

Re: [R] Specify a correct formula in R for Piecewise Linear Functions?

2008-01-02 Thread zhijie zhang
*example*( pmin ) is useful. I will use it from now on. Thanks a lot. On Jan 3, 2008 2:50 AM, Charles C. Berry [EMAIL PROTECTED] wrote: On Thu, 3 Jan 2008, zhijie zhang wrote: Some developments with confusions. I tried the spline method and dummy variable approach to do it. But their

[R] Specify a correct formula in R for Piecewise Linear Functions?

2008-01-01 Thread zhijie zhang
Dear all, I have two variables, y and x. It seems that the relationship between them is Piecewise Linear Functions. The cutpoint is 20. That is, when x20, there is a linear relationship between y and x; while x=20, there is another different linear relationship between them. How can i specify

Re: [R] Specify a correct formula in R for Piecewise Linear Functions?

2008-01-01 Thread Charles C. Berry
On Tue, 1 Jan 2008, zhijie zhang wrote: Dear all, I have two variables, y and x. It seems that the relationship between them is Piecewise Linear Functions. The cutpoint is 20. That is, when x20, there is a linear relationship between y and x; while x=20, there is another different linear