plot.gammi | R Documentation |
Plots main and interaction effects from a fit gammi object.
## S3 method for class 'gammi'
plot(x, terms = x$term.labels, conf.int = TRUE, n = 400,
intercept = FALSE, random = TRUE, ask = dev.interactive(),
xlab = NULL, ylab = NULL, zlab = NULL, main = NULL, ...)
x |
Object of class "gammi" |
terms |
Which model term(s) should be plotted? Default plots all terms. |
conf.int |
Should a 95% confidence interval be added to the plot(s)? |
n |
Number of points used to plot each of the (continuous) terms. |
intercept |
Should the intercept be added to the y-axis of the plot(s)? |
random |
Should Q-Q plots of the random coefficients be produced? |
ask |
Should the user be asked before each plot is produced? |
xlab |
Optional x-axis label for plot(s). |
ylab |
Optional y-axis label for plot(s). |
zlab |
Optional z-axis label for plot(s). |
main |
Optional title for plot(s). |
... |
Additional arguments passed to internal plotting functions. |
Default use plots each effect function along with a 95% confidence interval (if applicable). Line plots are used for continuous predictors, bar plots are used for categorical predictors, Q-Q plots are used for random effects, and image plots are used for two-way interactions. The visualizer1
and visualizer2
functions are used to plot main and interaction effects, respectively.
A plot is produced and nothing is returned.
Three-way and higher-order interactions are not currently supported.
Nathaniel E. Helwig <helwig@umn.edu>
Helwig, N. E. (2024). Precise tensor product smoothing via spectral splines. Stats, 7(1), 34-53, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3390/stats7010003")}
gammi
for fitting generalized additive mixed models
predict.gammi
for predicting from gammi
objects
summary.gammi
for summarizing results from gammi
objects
# load 'gammi' package
library(gammi)
# load data
data(exam)
# header of data
head(exam)
# fit model
mod <- gammi(Exam.score ~ VRQ.score, data = exam,
random = ~ (1 | Primary.school) + (1 | Secondary.school))
# plot terms
plot(mod)
# refit model with Secondary.school as penalized nominal effect
mod <- gammi(Exam.score ~ Secondary.school + VRQ.score, data = exam,
random = ~ (1 | Primary.school))
# plot terms
plot(mod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.