partial_residuals | R Documentation |
Partial residuals
partial_residuals(object, ...) ## S3 method for class 'gam' partial_residuals(object, select = NULL, partial_match = FALSE, ...)
object |
an R object, typically a model. Currently only objects of
class |
... |
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 load_mgcv() ## example data - Gu & Wabha four term model df <- data_sim("eg1", n = 400, seed = 42) ## fit the model m <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = df, method = 'REML') ## extract partial residuals partial_residuals(m) ## and for a select term partial_residuals(m, select = "s(x2)") ## or with partial matching partial_residuals(m, select = "x", partial_match = TRUE) # returns all
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.