Description Usage Arguments Details Value See Also Examples
3d plot of 2d smooths for generalized additive models.
1 2 3 4 5 6 7 8 9 | plot_gam_3d(
model,
main_var,
second_var,
conditional_data = NULL,
n_plot = 100,
dmb = FALSE,
...
)
|
model |
The mgcv gam model |
main_var |
The 'x' axis. |
second_var |
The 'y' axis' |
conditional_data |
Values for other covariates. Default is NULL see details. |
n_plot |
Points to plot. 100 (the default) works well. Embiggen at the cost of your own waiting time. |
dmb |
Whether to use plotly's display mode bar. Default is FALSE. |
... |
Arguments for scico |
This works like plot_gam_2d, the only difference being that a 3d plot is generated instead. It uses scico for the palette. It is expected that the two input variables are continuous
A plotly surface object
Other model visualization:
plot_coefficients.brmsfit()
,
plot_coefficients.lm()
,
plot_coefficients.merMod()
,
plot_coefficients()
,
plot_gam_2d()
,
plot_gam_check()
,
plot_gam()
1 2 3 4 5 6 7 | library(mgcv); library(visibly)
set.seed(0)
d = gamSim(2, scale=.1)$data
mod <- gam(y ~ s(x, z), data = d)
plot_gam_3d(mod, main_var = x, second_var = z)
plot_gam_3d(mod, main_var = x, second_var = z, palette='tokyo')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.