get_smooths_difference {tidymv} | R Documentation |
Get difference of smooths from a GAM model
Description
This function is from the superseded package tidymv. Please, use the tidygam package instead.
It returns a tibble with difference of the specified levels of a smooth from
a gam or bam. The sig_diff
column states
whether the CI includes 0.
Usage
get_smooths_difference(
model,
series,
difference,
conditions = NULL,
exclude_random = TRUE,
series_length = 100,
time_series
)
Arguments
model |
A |
series |
An unquoted expression indicating the model term that defines the series on which smoothing is applied. This is the term that is displayed on the x-axis when plotting. |
difference |
A named list with the levels to compute the difference of. |
conditions |
A named list specifying the levels to plot from the model
terms not among |
exclude_random |
Whether to exclude random smooths (the default is |
series_length |
An integer indicating how many values along the time series to use for predicting the outcome term. |
time_series |
Deprecated, use |
Value
A tibble.
Examples
library(mgcv)
set.seed(10)
data <- gamSim(4)
model <- gam(y ~ fac + s(x2) + s(x2, by = fac) + s(x0), data = data)
get_smooths_difference(model, x2, list(fac = c("1", "2")))
# For details, see vignette
## Not run:
vignette("plot-smooths", package = "tidymv")
## End(Not run)