LOESS (locally weighted smoothing) helps to smooth data over age, preserving the open age group if necessary. This is a simple wrapper to stats::loess() but using standard demographic arguments.
It is a popular tool to create a smooth line through a timeplot or scatter plot.
loess_smth1(Value, Age, OAG = TRUE, ...)
| Value | numeric vector of counts in single, abridged, or 5-year age groups. |
|---|---|
| Age | integer vector of ages corresponding to the lower integer bound of the counts. |
| OAG | logical. Whether or not the top age group is open. Default |
| ... | optional arguments passed to |
The total sum of Value is preserved in the output. One can control smoothness using the spar argument of stats::loess(). See loess for more details.