fast.plot: Creates moderated regression 3D graph

View source: R/graph3D.R

fast.plotR Documentation

Creates moderated regression 3D graph

Description

Creates moderated regression 3D graph

Usage

fast.plot(
  lm_object,
  criterion,
  predictor,
  moderator,
  center.predictors = FALSE,
  axis.labels = NULL,
  cam.position = NULL
)

Arguments

lm_object

Name of independent variable 1 column in data frame

criterion

Name of independent variable 2 column in data frame

predictor

Name of dependent variable column in data frame

moderator

Project data frame name

center.predictors

test

axis.labels

test

cam.position

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

Value

plotly object

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

head(grades)

lm_object <- lm(exam ~ anxiety + preparation + anxiety*preparation, data = grades)

# Example 1: Not mean centered
graph3D <- fast.plot(lm_object,
              criterion = exam,
              predictor = preparation,
              moderator = anxiety)
print(graph3D)

# Example 2: Mean centered
graph3Dcentered <- fast.plot(lm_object,
                        criterion = exam,
                        predictor = preparation,
                        moderator = anxiety
                        center.predictors = TRUE)
print(graph3Dcentered)

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