jnPlot: Draw johnson_neyman plot

View source: R/condPlot.R

jnPlotR Documentation

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 arguments 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 documentation built on Jan. 23, 2023, 5:44 p.m.