Learn R Programming

kim (version 0.5.431)

simple_slopes_analysis_logistic: Simple slopes analysis with logistic regression analyses

Description

Conduct a simple slopes analysis with logistic regression analyses, typically to probe a two-way interaction when the dependent variable is binary.

Usage

simple_slopes_analysis_logistic(
  data = NULL,
  iv_name = NULL,
  dv_name = NULL,
  mod_name = NULL,
  round_b = 2,
  round_se = 2,
  round_z = 2,
  round_p = 3,
  focal_values = NULL
)

Arguments

data

a data object (a data frame or a data.table)

iv_name

name of the independent variable (IV)

dv_name

name of the dependent variable (DV)

mod_name

name of the moderator variable (MOD)

round_b

number of decimal places to which to round coefficients from the regression analysis (default = 2)

round_se

number of decimal places to which to round standard error values from the regression analysis (default = 2)

round_z

number of decimal places to which to round t statistics from the regression analysis (default = 2)

round_p

number of decimal places to which to round p values from the regression analysis (default = 2)

focal_values

this input will be used only in cases where IV is continuous. In such cases, what are the focal values of the IV at which to estimate the effect of MOD on DV? By default, values corresponding to the mean of IV +/-1 SD will be used.

Examples

Run this code
# \donttest{
simple_slopes_analysis_logistic(
data = mtcars, iv_name = "vs", dv_name = "am", mod_name = "hp")
simple_slopes_analysis_logistic(
data = mtcars, iv_name = "disp", dv_name = "am", mod_name = "hp")
# }

Run the code above in your browser using DataLab