drawDD: Draw a double dissociation based on regression coefficients

View source: R/drawDD.R

drawDDR Documentation

Draw a double dissociation based on regression coefficients

Description

Draws a double dissociation based on regression coefficients.

Usage

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 = ""
)

Arguments

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

Details

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.

Value

Returns a plot with a (moderated) (robust) double dissociation.

Author(s)

Axel Zinkernagel zinkernagel@uni-landau.de

Examples

# See vignette


axzinker/axBoost documentation built on July 4, 2024, 9:14 p.m.