jnPlot | R Documentation |
Draw johnson_neyman plot
jnPlot( fit, pred = NULL, modx = NULL, digits = 3, plot = FALSE, mode = 1, xvar = "Z", addEq = FALSE, ... )
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() |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.