Displaying 1 result from an estimated 1 matches for "newframe2".
Did you mean:
newframe
2011 Mar 19
1
strange PREDICTIONS from a PIECEWISE LINEAR (mixed) MODEL
...x)
newframe[1:5,]
#predictions
yy2<-predict(mod2,level=0, newdata=newframe)
lines(x[order(x)],yy2[order(x)],col="blue",lwd=2)
# add variable in the model
z<-rgamma(1000,4,6)
mod3<-lme(y~x+x*(x>-1)+z
,random=~x|id,
data=data.frame(x,y,z,id))
summary(mod3)
#new id
newframe2<-data.frame( #fictious id
id="fictious",
x,
z)
#predict
yy3<-predict(mod3,level=0, newdata=newframe2)
lines(x[order(x)],yy3[order(x)],col="green",lwd=2)
# ADD INTERACTION z:x
mod4<-lme(y~x+x*(x>-1)+
z+
z:x+
z:x*(x>-1)
,random=~x|id,
d...