Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

condPlot2

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 od 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

Implementation of the 'PROCESS' Macro

v0.2.6
GPL-2
Authors
Keon-Woong Moon [aut, cre], Sokyoung Hong [ctb]
Initial release
2021-1-5

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.