powered by
Plots the smoothing function of GAM(M) predictors via ggplot2
plot_gam( model = NULL, pred = NULL, col_line = "blue", ci_line_col = "black", ci_line_type = "dashed", ci_fill = "grey", ci_alpha = 0.4, ci_line_size = 0.8, sm_fun_size = 1.1, title = NULL, xlab = NULL, ylab = NULL, limits_y = NULL, breaks_y = NULL )
A fitted model of class gam.
gam
Predictor name.
Smoothing function line color.
Confident interval line color.
Linetype of confidence interval.
Fill color of area between smoothing function and its confidence interval lines.
Opacity value of confidence interval.
Line sizes.
Plot title.
x-axis title.
y-axis title.
y-axis limits.
y-axis breaks. Values are handed over to a seq call, e.g. seq(-6, 6, 2).
seq
seq(-6, 6, 2)
or_gam() insert_or()
or_gam()
insert_or()
# NOT RUN { library(oddsratio) library(mgcv) fit_gam <- mgcv::gam(y ~ s(x0) + s(I(x1^2)) + s(x2) + offset(x3) + x4, data = data_gam ) plot_gam(fit_gam, pred = "x2", title = "Predictor 'x2'") # }
Run the code above in your browser using DataLab