partial_residuals {gratia} | R Documentation |
Partial residuals
Description
Partial residuals
Usage
partial_residuals(object, ...)
## S3 method for class 'gam'
partial_residuals(object, select = NULL, partial_match = FALSE, ...)
Arguments
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 |
Examples
## 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
[Package gratia version 0.9.2 Index]