[R] Problem with segmented function

2012-08-05 Thread stella
Hi, I appreciate your help with the segmented function. I am relatively new to R. I followed the introduction of the 'segmented'-package by Vito Muggeo, but still it does not work. Here are the lines I wrote: data_test<-data.frame(x=c(1:10),y=c(1,1,1,1,1,2,3,4,5,6)) lr_test<-lm(y~x,data_test) seg

Re: [R] Problem with segmented

2012-01-11 Thread Sarah Goslee
We really need the small reproducible example requested in the posting guide, including sample data, the actual R commands you used, the libraries required, and your OS and version of R. Sarah On Wed, Jan 11, 2012 at 9:08 AM, Filoche wrote: > Hi there. > > Here's the error message. > > Error in

Re: [R] Problem with segmented

2012-01-11 Thread Filoche
Hi there. Here's the error message. Error in seg.lm.fit(y, XREG, Z, PSI, weights, offs, opz) : (Some) estimated psi out of its range I have tried many ways to specify the arguments, but apparently the error message is related to the estimated break point being invalid. However, my estimation

Re: [R] Problem with segmented

2012-01-11 Thread Vito Muggeo (UniPa)
dear Phil, I am not able to read the error message.. did you forget it? However: does x exist in the workspace? The following lines work: myreg2 = lm(y ~ x, data=xy) mysegmented = segmented(myreg2, seg.Z=~x, psi=c(245000)) myreg2 = lm(xy$y ~ xy$x) x<-xy$x mysegmented = segmented(myreg2, seg.Z=

[R] Problem with segmented

2012-01-10 Thread Filoche
Hi everyone. I'm trying to use the segmented function with the following data: For instance, I use segmented package as follow: myreg2 = lm(xy$y ~ xy$x) mysegmented = segmented(myreg2, seg.Z=~x, psi=c(245000), control = seg.control(display=FALSE)) Which get me to the following error : As a