modregplot: modregplot

Description Usage Arguments Value Examples

Description

generates simple slopes plot from moderated regression equation

Usage

1
2
3
4
modregplot(predictor_range = c(-4, 4), moderator_values = c(-1, 0, 1),
  intercept = 0, predictor_coef = 0, moderator_coef = 0,
  interaction_coef = 0, predictor_label = "X", criterion_label = "Y",
  moderator_label = "Moderator")

Arguments

predictor_range

a length 2 vector of the range of values to be plotted on the predictor variable, Default: c(-4, 4)

moderator_values

a vector of moderator values to be plotted, Default: c(-1, 0, 1)

intercept

the intercept of the regression equation, Default: 0

predictor_coef

the regression coefficient for the predictor variable, Default: 0

moderator_coef

the regression coefficient for the moderator variable, Default: 0

interaction_coef

the interaction term coefficent, Default: 0

predictor_label

the label for the predictor variable, Default: 'X'

criterion_label

the label for the moderator variable, Default: 'Y'

moderator_label

PARAM_DESCRIPTION, Default: 'Moderator'

Value

a ggplot of the simple slopes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
modregplot(
  predictor_range = c(-2, 2),
  moderator_values = c(Low = -1, High = 1),
  intercept = 6,
  predictor_coef = 2,
  moderator_coef = 0,
  interaction_coef = 1,
  predictor_label = "Psychopathy",
  criterion_label = "Aggression",
  moderator_label = "Impulsivity"
)

wjschne/modregplot documentation built on June 25, 2019, 12:11 a.m.