Re: [R] using ddply with segmented regression

2013-10-16 Thread Jess Inskip
Hi Paul, Thanks for starting this thread. I have been struggling with the same plyr problems. I have also had some trouble moving onto the next step - integrating the segmented output with ggplot2 or lattice. Have you had any luck in this? There is good documentation on adding lm into ggpl

Re: [R] using ddply with segmented regression

2013-10-14 Thread Prew, Paul
m...@comcast.net] Sent: Monday, October 14, 2013 5:30 PM To: Prew, Paul Cc: arun; R help Subject: Re: [R] using ddply with segmented regression On Oct 14, 2013, at 2:57 PM, Prew, Paul wrote: > Hello, the code provided by arun did the trick. Thank you very much, arun. > > However, I&

Re: [R] using ddply with segmented regression

2013-10-14 Thread arun
h Center  | Mail Stop ESC-F4412-A 655 Lone Oak Drive  |  Eagan, MN 55121-1560 -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: Saturday, October 12, 2013 1:42 AM To: R help Cc: Prew, Paul Subject: Re: [R] using ddply with segmented regression Hi, Try: segmentf_df

Re: [R] using ddply with segmented regression

2013-10-14 Thread David Winsemius
> > Paul Prew | Statistician > 651-795-5942 | fax 651-204-7504 > Ecolab Research Center | Mail Stop ESC-F4412-A > 655 Lone Oak Drive | Eagan, MN 55121-1560 > > -Original Message- > From: arun [mailto:smartpink...@yahoo.com] > Sent: Saturday, Octobe

Re: [R] using ddply with segmented regression

2013-10-14 Thread Prew, Paul
y, October 12, 2013 1:42 AM To: R help Cc: Prew, Paul Subject: Re: [R] using ddply with segmented regression Hi, Try: segmentf_df <- function(df) { out.lm<-lm(deltaWgt~Cycle, data=df) segmented(out.lm,seg.Z=~Cycle, psi=(Cycle=NA),control=seg.control(stop.if.error=FALSE,n.boot=0)) } librar

Re: [R] using ddply with segmented regression

2013-10-11 Thread arun
Hi, Try: segmentf_df <- function(df) { out.lm<-lm(deltaWgt~Cycle, data=df) segmented(out.lm,seg.Z=~Cycle, psi=(Cycle=NA),control=seg.control(stop.if.error=FALSE,n.boot=0)) } library(plyr) library(segmented) dlply(df,.(Lot.Run),segmentf_df) $`J062431-1` Call: segmented.lm(obj = out.lm, seg.Z =

[R] using ddply with segmented regression

2013-10-11 Thread Prew, Paul
Hello, I’m unsuccessfully trying to apply piecewise linear regression over each of 22 groups. The data structure of the reproducible toy dataset is below. I’m using the ‘segmented’ package, it worked fine with a data set that containing only one group (“Lot.Run”). $ Cycle : int