I have "smoothed" rather than using a linear line between X and Y.

My R code is the following :

# Loess model

plot(Y ~ X)

loess.model <- loess(Dataset$Y ~ Dataset$X)

loess.model

hat <- predict(loess.model)

lines(Dataset$X[order(Dataset$X)], hat[order(Dataset$X)], col="red")

Number of Observations: 52

Equivalent Number of Parameters: 4.62

Residual Standard Error: 0.9877

1) This R code here above doesn't give me the R-square. Strange because I think that one way to get the R-square is to square the correlation between the original y-values and the predicted y-values at the same point - what I call hat in my R code.

How can I get the R-square of the loess fit ? Could You give me the R code ?

2) My R code uses the predict function on a loess object to get the curve. Now, if I want to make predictions with LOESS. How can I use the predict function on new x values ?

3) Using R, how can I get the confidence interval to know if the curvature is real/important or if a straight line would probably fit as well and any curvature is due to chance ?

Looking forward to reading You soon.

Figone