mediate_plot: Create a plot for mediation analysis

View source: R/plot_mediate_plot.R

mediate_plotR Documentation

Create a plot for mediation analysis

Description

Create a plot for mediation analysis

Usage

mediate_plot(formula, data, method = "lm", ...)

Arguments

formula

A formula with y on the left side and the predictors on the right. The last variable entered will be plotted on the x-axis

data

The dataset

method

The fitted line. Defaults to "lm".

...

Other parameters passed to flexplot

Value

a plot showing the mediation effect

Examples

mediate_plot(weight.loss~motivation + health, data=exercise_data)
mediate_plot(weight.loss~motivation + therapy.type, data=exercise_data)

dustinfife/flexplot documentation built on Sept. 23, 2024, 9:01 p.m.