[R] graphics: 3D regression plane

agent dunham crosspide at hotmail.com
Tue Apr 26 17:18:38 CEST 2011


Dear community, 

As it's explained I've tried the following: 

model<- lm(log(v1)~log(v2)+v3, data=dat)
newax<- expand.grid( 
    v2 = seq(min(log(dat$v2)), max(log(dat$v2)), length=100), 
    v3= seq(min(dat$v3), max(dat$v3), length=100) 
    ) 
fit <- predict(model,newax) 
graph <- persp(x=seq(min(log(dat$v2)), max(log(dat$v2)), length=100), 
                y=seq(min(dat$v3), max(dat$v3), length=100), 
                z= matrix(fit, 100, 100), expand=0.5, ticktype="detailed",
theta=-45) 

question: I'd like to draw a line which links the fitted (x,y,z) point in
the plane, with the observed (x,y,z_o) point. How can I do it?

Thanks in advance, user at host.com





--
View this message in context: http://r.789695.n4.nabble.com/graphics-3D-regression-plane-tp3214007p3475718.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list