Add partial residuals
Add partial residuals
add_partial_residuals(data, model, ...) ## S3 method for class 'gam' add_partial_residuals(data, model, select = NULL, partial_match = FALSE, ...)
data |
a data frame containing values for the variables used to fit the
model. Passed to |
model |
a fitted model for which a |
... |
arguments passed to other methods. |
select |
character, logical, or numeric; which smooths to plot. If
|
partial_match |
logical; should smooths be selected by partial matches
with |
load_mgcv() df <- data_sim("eg1", seed = 1) df <- df[, c("y","x0","x1","x2","x3")] m <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = df, method = 'REML') ## add partial residuals add_partial_residuals(df, m) ## add partial residuals for selected smooths add_partial_residuals(df, m, select = "s(x0)")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.