smooth.spline_tidiers {broom} | R Documentation |
This combines the original data given to smooth.spline with the fit and residuals
## S3 method for class 'smooth.spline' augment(x, data = x$data, ...) ## S3 method for class 'smooth.spline' glance(x, ...)
x |
a smooth.spline object |
data |
defaults to data used to fit model |
... |
not used in this method |
No tidy
method is provided for smooth.spline objects.
augment
returns the original data with extra columns:
.fitted |
Fitted values of model |
.resid |
Residuals |
glance
returns one row with columns
spar |
smoothing parameter |
lambda |
choice of lambda corresponding to |
df |
equivalent degrees of freedom |
crit |
minimized criterion |
pen.crit |
penalized criterion |
cv.crit |
cross-validation score |
spl <- smooth.spline(mtcars$wt, mtcars$mpg, df = 4) head(augment(spl, mtcars)) head(augment(spl)) # calls original columns x and y library(ggplot2) ggplot(augment(spl, mtcars), aes(wt, mpg)) + geom_point() + geom_line(aes(y = .fitted))