Re: [R] 2D contour predictions

2005-07-16 Thread Spencer Graves
It's not so simple, but consider the following: x=rep(1:6, each=2, length=24) y=rep(1:6, each=4) z=rep(0:1, length=24) set.seed(1) tstDF - data.frame(x=x, y=y, z=z, w=(x-3.5)^2+(y-3.5)+z+0.1*rnorm(24)) fit - lm(w~x+y+z+I(x^2)+I(y^2), tstDF) x0 - seq(1, 5, .5) y0 - seq(1, 6,

[R] 2D contour predictions

2005-07-15 Thread Michael Hopkins
Hi All I have been fitting regression models and would now like to produce some contour image plots from the predictors. Is there an easy way to do this? My current (newbie) experience with R would suggest there is but that it's not always easy to find it! f3 - lm( fc ~ poly( speed, 2 ) +