fast.plot | R Documentation |
Creates moderated regression 3D graph
fast.plot(
lm_object,
criterion,
predictor,
moderator,
center.predictors = FALSE,
axis.labels = NULL,
cam.position = NULL
)
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. |
plotly object
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
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.