plot.probeInteraction {MDMA}R Documentation

plot probed interaction

Description

Plot the effects of the antecedent as a function of the moderator.

[Stable]

Usage

## S3 method for class 'probeInteraction'
plot(
  x,
  ...,
  col.JN = "red",
  lty.JN = "dotted",
  col.CI = rgb(red = 0.5, green = 0.5, blue = 0.5, alpha = 0.2),
  lty.CI = "longdash",
  lty.0 = "dotted"
)

Arguments

x

object of class probeInteraction.

...

other arguments (none are used).

col.JN

color for Johnson-Neyman cut-off line(s).

lty.JN

linetype for Johnson-Neyman cut-off line(s).

col.CI

color of the shade for the confidence interval.

lty.CI

linetype for confidence interval boundaries.

lty.0

linetype for the horizontal line where the effect of the focal predictor on the outcome equals 0.

Value

plot.probeInteraction returns a combined plot with p value on the first y axis and effect of the antecedent variable.

Author(s)

Mathijs Deen

Examples

lm.1 <- lm(mpg ~ hp * wt, data = mtcars)
pI.1 <- probeInteraction(lm.1, hp, wt, JN=TRUE, n.interval.moderator = 3,
                         quantile.moderator = c(0.1,0.9), values.moderator = 2)
plot(pI.1)
lm.2 <- lm(mpg ~ qsec * drat, data = mtcars)
pI.2 <- probeInteraction(lm.2, qsec, drat, JN=TRUE, n.interval.moderator = 30,
                         quantile.moderator = c(0.1,0.9), values.moderator = 2)
plot(pI.2)

[Package MDMA version 1.1.0 Index]