# LOESS smoothing fit

Here are 3 questions about the LOESS smoothing fit.

# 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. Is it possible to get the R-square of the loess fit (red curve)? If yes, how can I get the R-square? Could you give me the R code?
2. It is impossible to get the equation of the smoothing fit (red curve). Therefore we can not do any prediction with a smoothing fit LOESS? On the contrary we can easily do/make prediction with the linear line.
3. What is the main purpose to use a smoothing fit instead of a linear line? Is the smoothing fit more accurate, although we can not do any prediction?

There is a function in the TeachingDemos package called loess.demo that helps with the understanding of loess models, reading the documentation and running that function a few times may help with your understanding.
1) One way to get an R-square value is to square the correlation between the original y-values and the predicted y-values at the same point (what you call hat). Of course, since there is discussion about the validity of R-square values for regular linear regression you should be cautious of any interpretation here.
2) It is not impossible to get the equation of the smooth curve (finding meaning from it is another thing). And just because you don't have the equation does not mean that you cannot make predictions, your code uses the predict function on a loess object to get the curve, you can also use predict on new x values as well.