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

jnPlot

Draw johnson_neyman plot


Description

Draw johnson_neyman plot

Usage

jnPlot(
  fit,
  pred = NULL,
  modx = NULL,
  digits = 3,
  plot = FALSE,
  mode = 1,
  xvar = "Z",
  addEq = FALSE,
  ...
)

Arguments

fit

A regression model

pred

name of predictor variable

modx

name of moderator variable

digits

integer indicating the number of decimal places

plot

logical. Whether or not draw plot

mode

integer 1 or 2

xvar

Name of xvar

addEq

logical

...

Further argumant to be passed to interactions::johnson_neyman()

Examples

fit=lm(mpg~hp*wt,data=mtcars)
jnPlot(fit)

fit=lm(justify~frame*skeptic,data=disaster)
res=jnPlot(fit)
res$plot
fit=lm(govact~negemot*sex*age+posemot+ideology,data=glbwarm)
jnPlot(fit,pred="negemot:sex",modx="age",mode=2,addEq=TRUE)

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.