I am trying to do a LOESS model for predicting Y based on the independent variable X
data sample is,
x <- c(10, 20, 25, 32, 40)
y <- c(1200, 1400, 1460, 1620, 1800)
steps i use is as following,
lw1 <- loess(y ~ x,data=data)
plot(y ~ x, data=data,pch=19,cex=0.1)
j <- order(data$x)
lines(data$x[j],lw1$fitted[j])
In above data sample , we have only 1 independent variable x.
Now what if we have 2 independent variable?? How to get a model for the following sample data,
x1 <- c(10,20,25,32,40)
x2 <- c(1.2,1.4,1.5,2.1,2.8)
y <- c(1200,1400,1460,1620,1800)
Please help me with an R sample, how can we deal with X1 and X2 in a LOESS model???