interaction-plot: Two-way interaction plot

interaction-plotR Documentation

Two-way interaction plot

Description

Plots the mean of the response for two-way combinations of factors, thereby illustrating possible interactions.

Usage

interaction_plot(.data, .formula, interval = "conf.int")

Arguments

.data

A data frame

.formula

A formula of the form y ~ x1 + x2

interval

Either conf.int, boxplot or none

Note

This is a recent addition to the package and is subject to change.

Examples


income$educf <- cut(income$educ, breaks=3)
income |> interaction_plot(inc ~ race + educf)
income |> interaction_plot(inc ~ race + educf, interval="conf.int")
income |> interaction_plot(inc ~ race + educf, interval="boxplot")
income |> interaction_plot(inc ~ race + educf, interval="none")


doBy documentation built on June 30, 2025, 1:06 a.m.