better_parametric_plot.Rd
better_parametric_plot
creates a point plot with confidence interval ranges using ggplot2
. It basically is a wrapper for itsadug
's
plot_parametric
function.
better_parametric_plot(
qgam,
quantile = NULL,
pred,
cond = NULL,
print.summary = FALSE,
plot.old = FALSE,
order = NULL,
xlab = "fit",
ylab = NULL,
size = 0.5,
color = NULL,
alpha = 1)
A qgam object created with qgam::qgam
or extracted from a qgam::mqgam
object, or a collection of qgams created with qgam::mqgam
.
If qgam
is a collection of qgam models, specify the quantile you are interested in. Not meaningful for single qgam objects.
The predictor term to plot. Note: This is no longer identical to the pred
argument specified for itsadug::plot_parametric
.
A named list of the values to use for the other predictor terms (not in view). Used for choosing between smooths that share the same view predictors.
Logical: whether or not to print summary.
Plot the original plot_parametric
as well.
Specify the order with which the levels given in pred
should be plotted.
The x-axis label.
The y-axis label.
Size argument for the ggplot object; specifies the size of points and lines.
Color argument for the ggplot object; specifies the color of points and lines.
Alpha argument for the ggplot object; specifies the transparency of points and lines.
A ggplot object.
Fasiolo M., Goude Y., Nedellec R., & Wood S. N. (2017). Fast calibrated additive quantile regression. URL: https://arxiv.org/abs/1707.03307
van Rij J, Wieling M, Baayen R, & van Rijn H (2020). itsadug: Interpreting Time Series and Autocorrelated Data Using GAMMs. R package version 2.4.
Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York.
# using a single qgam extracted from an mqgam object OR fitted with qgam::qgam
better_parametric_plot(qgam = mtqgam_qgam,
pred = "factor_3")
#> i Plotting predictor factor_3 with default order of predictor levels.
# using a qgam that is part of an mqgam object
library(qgam)
#> Warning: package 'qgam' was built under R version 4.0.5
#> Loading required package: mgcv
#> Loading required package: nlme
#> This is mgcv 1.9-0. For overview type 'help("mgcv-package")'.
better_parametric_plot(qgam = mtqgam_mqgam,
quantile = 0.5,
pred = "factor_3")
#> i Plotting predictor factor_3 with default order of predictor levels.
# combining better_parametric_plot with ggplot2
better_parametric_plot(qgam = mtqgam_qgam,
pred = "factor_3") +
theme_void() +
labs(subtitle = "This is a subtitle")
#> i Plotting predictor factor_3 with default order of predictor levels.