condPlot2: Draw conditional plot for moderated moderation

View source: R/condPlot2.R

condPlot2R Documentation

Draw conditional plot for moderated moderation

Description

Draw conditional plot for moderated moderation

Usage

condPlot2(
  fit,
  pred = NULL,
  modx = NULL,
  mod2 = NULL,
  mod2.values = NULL,
  rangemode = 1,
  vjust = NULL,
  digits = 3,
  addlabel = TRUE,
  xvar = "Z",
  ...
)

Arguments

fit

An object of class lm

pred

name of the predictor variable

modx

name of the moderator variable

mod2

name of the second moderator variable

mod2.values

values of moderator variable

rangemode

integer. 1 or 2

vjust

integer

digits

integer indicating the number of decimal places

addlabel

logical

xvar

character. "Z" or "W"

...

Further arguments to be passed to predict3d::ggPredict()

Examples

fit=lm(govact~negemot*sex*age+posemot+ideology,data=glbwarm)
## Not run: 
condPlot2(fit)
condPlot2(fit,mod2.values = c(30,50,70))
fit1=lm(govact~negemot*age*sex+posemot+ideology,data=glbwarm)
condPlot2(fit1,pred="negemot",modx="sex",mod2="age",mod2.values = c(30,50,70),xvar="W")

## End(Not run)

processR documentation built on Jan. 23, 2023, 5:44 p.m.