plot_1Dsmooth {APCtools} | R Documentation |
Plot 1D smooth effects for gam
models
Description
Plots 1D smooth effects for a GAM model fitted with gam
or bam
.
Usage
plot_1Dsmooth(
model,
plot_ci = TRUE,
select,
alpha = 0.05,
ylim = NULL,
method_expTransform = "simple",
return_plotData = FALSE
)
Arguments
model |
|
plot_ci |
If |
select |
Index of smooth term to be plotted. |
alpha |
|
ylim |
Optional limits of the y-axis. |
method_expTransform |
One of |
return_plotData |
If TRUE, the dataset prepared for plotting is returned. Defaults to FALSE. |
Details
If the model was estimated with a log or logit link, the function
automatically performs an exponential transformation of the effect,
see argument method_expTransform
.
Value
ggplot object
Author(s)
Alexander Bauer alexander.bauer@stat.uni-muenchen.de
Examples
library(APCtools)
library(mgcv)
data(travel)
model <- gam(mainTrip_distance ~ te(age, period) + residence_region +
household_size + s(household_income), data = travel)
plot_1Dsmooth(model, select = 2)