drawDD | R Documentation |
Draws a double dissociation based on regression coefficients.
drawDD(
data,
predUpper,
predLower,
critUpper,
critLower,
covUpper = NULL,
covLower = NULL,
covResidAsDep = FALSE,
plotCov = TRUE,
moderator = NULL,
moderatorSD = c(-1, 1),
modLabSeq = 1,
plotRange = 1,
modBothPaths = FALSE,
robust = FALSE,
printReg = FALSE,
title = ""
)
data |
A data frame containing the numeric columns predUpper, predLower, critUpper, critLower, and optionally covariates and a moderator. |
predUpper |
String with the name of the predictor of the upper double dissociation path. |
predLower |
String with the name of the predictor of the lower double dissociation path. |
critUpper |
String with the name of the criterion of the upper double dissociation path. |
critLower |
String with the name of the criterion of the lower double dissociation path. |
covUpper |
Optional string vector with the names of the covariates for the criterion of the upper double dissociation path. |
covLower |
Optional string vector with the names of the covariates for the criterion of the lower double dissociation path. |
covResidAsDep |
If FALSE (the default), a multiple regression is computed. If TRUE, the residuals of the covariate regression are used as dependent variable. |
plotCov |
Include covariates in the lower part of the plot. Default is TRUE, but can be switched off (e.g., if variable names are too long) |
moderator |
String with the name of the Moderator of the upper and lower direct path from predictor to criterion |
moderatorSD |
Defines the standard deviations for which the slope lines are plotted. Default is -1 and 1. For example, for experimetal group / control group design use c(0,1). |
modLabSeq |
Moderation label sequence (1 or 2). Cope with the lm() function, which puts out the labels in 2 different orders pred:mod (which is 1), or mod:pred (which is 2). Default is 1. |
plotRange |
Plot range of the square plot of a (marginally) significant interaction (only works with default of 1 SD at the moment). |
modBothPaths |
If TRUE, a moderator effect is computed for both paths. Default is FALSE. |
robust |
Logical value if robust parameter estimation is used (robust::lmRob() and WRS2::pbcor()). Default is FALSE. |
printReg |
Print the summary () of the regression coefficients. Default is FALSE. |
title |
Title of plot |
Assuming a double dissociation, the function computes two regressions:
critUpper ~ predUpper + predLower
critLower ~ predLower + predUpper
If covariates are givem, the function is computed as:
critUpper ~ covUpper + predUpper + predLower
critLower ~ covLower + predLower + predUpper
If covResidAsDep is false, this is done as a multiple regression. If it is true, this is done for the residuals of the covUpper/covLower regressions as dependent variable. It works also in combination with moderators.
If a moderator is given, the regressions are computed as:
critUpper ~ predUpper * moderator + predLower
critLower ~ predLower * moderator + predUpper
If modBothPaths = TRUE, the regressions are computed as:
critUpper ~ predUpper * moderator + predLower * moderator
critLower ~ predLower * moderator + predUpper * moderator
All variables are scaled before computing the regressions to cope with multicolinearity in the moderated case.
Returns a plot with a (moderated) (robust) double dissociation.
Axel Zinkernagel zinkernagel@uni-landau.de
# See vignette
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.