fast.int: Creates moderated regression output and graphs (2D/3D)

View source: R/main.R

fast.intR Documentation

Creates moderated regression output and graphs (2D/3D)

Description

Creates moderated regression output and graphs (2D/3D)

Usage

fast.int(
  data,
  criterion,
  predictor,
  moderator,
  center.predictors = FALSE,
  axis.labels = NULL,
  path = NULL,
  cam.position = NULL
)

Arguments

data

Name of data frame

criterion

Name of criterion variable

predictor

Name of predictor variable

moderator

Name of predictor variable

center.predictors

Boolean. Indicate if predictors hsould be centered. Default is FALSE.

axis.labels

Optional. Override column names as axis labels by sending in a list of new names.

path

Optional. If specified creates a file at the path. Use a filename as "myfile.doc" or "myfile.rtf" for regression tables

cam.position

A list with theta (degrees), phi (degrees), and distance values. Suggest default distance of 3.

Value

A list with seven objects. Specifically the objects: regression.lm.object (regression for overall analysis), apa.table (a data frame with the results table of the overall analysis), Overall.R2.F (a string with results for overall percxentage of variance), simple.slope.table (a table of the simple slopes), graph2D (a formatted ggplot graph), graph2Dunformatted (an unformatted ggplot graph), and graph3D (a plot.ly surface graph).

References

Cohen, J., Cohen, P., West, S. G., & Aiken, L. S. (2003). Applied multiple regression. Correlation Analysis for the Behavioral Sciences (3rd Edition). Lawerence Earlbaum Associates: London. ISBN-13: 978-0805822236

Examples


# Compare results to Table 7.4.1 from Cohen, Cohen, West, and Aiken (2003)

results <- fast.int(data = cohen_exercise,
                criterion = endurance,
                predictor = age,
                moderator = exercise,
                center.predictors = TRUE)

print(results)

dstanley4/fastInteraction documentation built on July 5, 2023, 6:40 a.m.