[R] 3d surface plot

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu May 13 16:47:30 CEST 2010

On 11.05.2010 23:25, kun.zhao at wmich.edu wrote:
> Hi,Sir or Miss:
> We meet a problem of plotting 3d, which is a part of 5D. In other word, we just fixed the rest of 2 variables and slice 5d into 3d.
> Consider a function like Y=f(x1, x2, x3, x4). We want to  have a 3D surface plot in R for the fitted value Yhat (which is of course a function of x1, x2, x3 and x4) against x1 and x2 say, keeping x3 at its median level and fixing x4 as =1 (note that x4 is binary which can take values of 1 or 0 only). So we plot yhat, x1 and x2 in 3D surface after estimating the whole model (based on all 4 covariates) .

See ?persp.

Uwe Ligges

> Awaiting your reply.
> Thanks for your time,
> Best
> Kun
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list