Re: [R] strange PREDICTIONS from a PIECEWISE LINEAR (mixed) MODEL

2011-03-21 Thread Kevin Wright
1. Try using set.seed for better reproducibility. 2. Does this really work for you? I get mydf <- data.frame(x, y,id) mod2<-lme(y ~ x + x*(x>-1), random=~x|id, + data=mydf) Error in lme.formula(y ~ x + x * (x > -1), random = ~x | id, data = mydf) : nlminb problem, convergence error c

[R] strange PREDICTIONS from a PIECEWISE LINEAR (mixed) MODEL

2011-03-19 Thread Federico Bonofiglio
Hi Dears, When I introduce an interaciton in a piecewise model I obtain some quite unusual results. If that would't take u such a problem I'd really appreciate an advise from you. I've reproduced an example below... Many thanks x<-rnorm(1000) y<-exp(-x)+rnorm(1000) plot(x,y) abline(v=-1,c