Below is an example scatter plot between the variable
LWAGE (Log of salary) and the variable
EXPER(number of years of experience) for a sample size
n=3000. In this scatter plot there is the straight line OLS (green) and the curved line (nonparametric method lowess in red).
Here are the R codes :
scatterplot(Dataset$LWAGE~Dataset$EXPER, reg.line=lm, smooth=FALSE, spread=FALSE, boxplots=FALSE, span=0.5, data=Dataset) lines(lowess(Dataset$EXPER,Dataset$LWAGE),col='red', lwd=2)
I would have appreciated to know the R codes to get the equation of the straight line OLS (in green) and the equation for the curved line (lowess in red)?
The result for the OLS straight line should be something like:
LWAGE = 6.25 + 0.05*EXPER