It plots the difference smooth from a gam or bam. Significant differences are marked with red areas.
plot_difference( model, series, difference, conditions = NULL, exclude_random = TRUE, series_length = 100, ci_z = 1.96, time_series )
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. |
ci_z | The z-value for calculating the CIs (the default is |
time_series | Deprecated, use |
A ggplot object.
#> Factor `by' variable example