if (FALSE) {
data(plant)
lattice::xyplot(y~time,groups=group,auto.key=list(space="right"), data=plant)
o<-segreg(y~ group+seg(time, by=group, npsi=2), data=plant)
summary(o)
with(plant, plot(time, y))
plot(o, 1, add=TRUE)
plot(o, 2, add=TRUE, col=3)
plot(o, 3, add=TRUE, col=4)
}
Run the code above in your browser using DataLab