View source: R/gam_riskfactor.R
| autoplot.riskfactor_gam | R Documentation |
risk_factor_gam()Generates a ggplot2 visualization of a fitted GAM created with
risk_factor_gam(). The plot shows the fitted curve, and optionally confidence
intervals and observed data points.
## S3 method for class 'riskfactor_gam'
autoplot(
object,
confidence = FALSE,
color_gam = "steelblue",
show_observations = FALSE,
x_stepsize = NULL,
size_points = 1,
color_points = "black",
rotate_labels = FALSE,
remove_outliers = NULL,
conf_int = NULL,
...
)
object |
An object of class |
confidence |
Logical. If |
color_gam |
Color for the fitted GAM line, specified by name (e.g.,
|
show_observations |
Logical. If |
x_stepsize |
Numeric. Step size for tick marks on the x-axis. If
|
size_points |
Numeric. Point size for observed data. Default is |
color_points |
Color for the observed data points. Default is |
rotate_labels |
Logical. If |
remove_outliers |
Numeric. If specified, observations greater than this threshold are omitted from the plot. |
conf_int |
Deprecated. Use |
... |
Additional arguments passed to underlying |
A ggplot object representing the fitted GAM.
Martin Haringa
## Not run:
library(ggplot2)
fit <- risk_factor_gam(MTPL,
risk_factor = "age_policyholder",
claim_count = "nclaims",
exposure = "exposure")
autoplot(fit, show_observations = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.