Arguments
- object
a "mid" object.
- terms
a character vector. The names of the terms to be visualized.
- limits
NULL
or a numeric vector of length two specifying the limits of the plotting scale.NA
s are replaced by the minimum and/or maximum MID values.- intercept
logical. If
TRUE
, the intercept is added to the MID values and the plotting scale is shifted.- main.effects
logical. If
TRUE
, the main effects are included in the interaction plot.- max.plots
an integer specifying the number of maximum number of plots.
- engine
character string. One of "ggplot2" or "graphics".
- ...
Value
If engine
is "ggplot2", mid.plots()
returns a list of "ggplot" objects. Otherwise mid.plots()
produces plots and returns NULL
.
Examples
data(diamonds, package = "ggplot2")
set.seed(42)
idx <- sample(nrow(diamonds), 1e4L)
mid <- interpret(price ~ (carat + cut + color + clarity) ^ 2, diamonds[idx, ])
#> 'model' not passed: response variable in 'data' is used
mid.plots(mid, c("carat", "color", "carat:color", "clarity:color"), limits = NULL)
#> $carat
#>
#> $color
#>
#> $`carat:color`
#>
#> $`clarity:color`
#>