> I tried to create a 3D surface showing the interaction between two > continuous explanatory variables; the response variable is > binary (0/1). > > The model is: > > model<-glm(incidence~sun*trees,binomial) > > then I used "wireframe" to create a 3D plot: > > xyz<-expand.grid(sun=seq(30,180,1),trees=seq(0,4000,10)) > > xyz$incidence<-as.vector(predict(model,xyz))
xyz$incidence<-as.vector(predict(model,xyz, type= "response")) should work > wireframe(incidence~sun*trees,xyz,scales=list(arrows=FALSE)) Cheers, Lorenz ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html