Skip to content
Prev 334056 / 398513 Next

How to generate a smoothed surface for a three dimensional dataset?

Jun:

You need to:

1. Read the docs
2. Consult a local statistician, as you seem to be out of your depth
statistically here.

Re: 1:

?predict.loess explicitly says:

"If newdata was the result of a call to expand.grid, the predictions
(and s.e.'s if requested) will be an **array** of the appropriate
dimensions." (emphasis added)

So change your assignment to:

df$z <- as.vector(predict(fit.loess,
newdata=df))


## or maybe if plot3d accepts a matrix argument (I don't do 3d plots),
more directly:

plot3d(predict(fit.loess,newdata = df))  ## May Not Work!!

Re: 2

Your comment that:

" I can see the critical point here is to find a right function to
make the prediction. "

is what indicates to me that your "critical point" is that you have
insufficient knowledge and need help. Feel free to disagree, of
course.

Cheers,
Bert
On Thu, Dec 5, 2013 at 7:33 AM, Jun Shen <jun.shen.ut at gmail.com> wrote: