Local polynomial regression


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)
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.

I guess I got responses to my 2 first questions.

## to get the R.square
SSE=sum((Dataset$Y-predict(loess.model) )^2)

## to predict

But I still don't know how to get the confidence interval. My third question. So any help would be very Kind from You.
Thanks !