Learn R Programming

psychmeta (version 2.6.4)

compute_dmod_par: Function for computing parametric d_Modd_Mod effect sizes for any number of focal groups

Description

This function computes d_Modd_Mod effect sizes from user-defined descriptive statistics and regression coefficients. If one has access to a raw data set, the dMod function may be used as a wrapper to this function so that the regression equations and descriptive statistics can be computed automatically within the program.

Usage

compute_dmod_par(
  referent_int,
  referent_slope,
  focal_int,
  focal_slope,
  focal_mean_x,
  focal_sd_x,
  referent_sd_y,
  focal_min_x,
  focal_max_x,
  focal_names = NULL,
  rescale_cdf = TRUE
)

Value

A matrix of effect sizes (d_Mod_Signedd_Mod_Signed,

d_Mod_Unsignedd_Mod_Unsigned, d_Mod_Underd_Mod_Under,

d_Mod_Overd_Mod_Over), proportions of under- and over-predicted criterion scores, minimum and maximum differences (i.e., d_Mod_Underd_Mod_Under and d_Mod_Overd_Mod_Over), and the scores associated with minimum and maximum differences. Note that if the regression lines are parallel and infinite focal_min_x and focal_max_x values were specified, the extrema will be defined using the scores 3 focal-group SDs above and below the corresponding focal-group means.

Arguments

referent_int

Referent group's intercept.

referent_slope

Referent group's slope.

focal_int

Focal groups' intercepts.

focal_slope

Focal groups' slopes.

focal_mean_x

Focal groups' predictor-score means.

focal_sd_x

Focal groups' predictor-score standard deviations.

referent_sd_y

Referent group's criterion standard deviation.

focal_min_x

Focal groups' minimum predictor scores.

focal_max_x

Focal groups' maximum predictor scores.

focal_names

Focal-group names. If NULL (the default), the focal groups will be given numeric labels ranging from 1 through the number of groups.

rescale_cdf

Logical argument that indicates whether parametric d_Modd_Mod results should be rescaled to account for using a cumulative density < 1 in the computations (TRUE; default) or not (FALSE).

Details

The d_Mod_Signedd_Mod_Signed effect size (i.e., the average of differences in prediction over the range of predictor scores) is computed as d_Mod_Signed=1SD_Y_1 f_2(X)[X(b_1_1-b_1_2)+b_0_1-b_0_2] dX,d_Mod_Signed = 1/SD_Y_1 * integrate(f_2(X) * [X * (b_1_1 - b_1_2) + b_0_1 - b_0_2]), where

  • SD_Y_1Y_1 is the referent group's criterion standard deviation;

  • f_2(X)f_2(X) is the normal-density function for the distribution of focal-group predictor scores;

  • b_1_1b_1_1 and b_1_0b_1_0 are the slopes of the regression of Y on X for the referent and focal groups, respectively;

  • b_0_1b_0_1 and b_0_0b_0_0 are the intercepts of the regression of Y on X for the referent and focal groups, respectively; and

  • the integral spans all X scores within the operational range of predictor scores for the focal group.

The d_Mod_Underd_Mod_Under and d_Mod_Overd_Mod_Over effect sizes are computed using the same equation as d_Mod_Signedd_Mod_Signed, but d_Mod_Underd_Mod_Under is the weighted average of all scores in the area of underprediction (i.e., the differences in prediction with negative signs) and d_Mod_Overd_Mod_Over is the weighted average of all scores in the area of overprediction (i.e., the differences in prediction with negative signs).

The d_Mod_Unsignedd_Mod_Unsigned effect size (i.e., the average of absolute differences in prediction over the range of predictor scores) is computed as d_Mod_Unsigned=1SD_Y_1 f_2(X)|X(b_1_1-b_1_2)+b_0_1-b_0_2|dX.d_Mod_Unsigned = 1/SD_Y_1 * integrate(f_2(X) * |X * (b_1_1 - b_1_2) + b_0_1 - b_0_2|).

The d_Mind_Min effect size (i.e., the smallest absolute difference in prediction observed over the range of predictor scores) is computed as d_Min=1SD_Y_1Min[|X(b_1_1-b_1_2)+b_0_1-b_0_2|].d_Min = 1/SD_Y_1 * Min[X * (b_1_1 - b_1_2) + b_0_1 - b_0_2].

The d_Maxd_Max effect size (i.e., the largest absolute difference in prediction observed over the range of predictor scores)is computed as d_Max=1SD_Y_1Max[|X(b_1_1-b_1_2)+b_0_1-b_0_2|].d_Max = 1/SD_Y_1 * Max[X * (b_1_1 - b_1_2) + b_0_1 - b_0_2]. Note: When d_Mind_Min and d_Maxd_Max are computed in this package, the output will display the signs of the differences (rather than the absolute values of the differences) to aid in interpretation.

If d_Modd_Mod effect sizes are to be rescaled to compensate for a cumulative density less than 1 (see the rescale_cdf argument), the result of each effect size involving integration will be divided by the ratio of the cumulative density of the observed range of scores (i.e., the range bounded by the focal_min_x and focal_max_x arguments) to the cumulative density of scores bounded by -Inf and Inf.

References

Nye, C. D., & Sackett, P. R. (2017). New effect sizes for tests of categorical moderation and differential prediction. Organizational Research Methods, 20(4), 639–664. tools:::Rd_expr_doi("10.1177/1094428116644505")

Examples

Run this code
compute_dmod_par(referent_int = -.05, referent_slope = .5,
                 focal_int = c(.05, 0, -.05), focal_slope = c(.5, .3, .3),
                 focal_mean_x = c(-.5, 0, -.5), focal_sd_x = rep(1, 3),
                 referent_sd_y = 1,
                 focal_min_x = rep(-Inf, 3), focal_max_x = rep(Inf, 3),
                 focal_names = NULL, rescale_cdf = TRUE)

Run the code above in your browser using DataLab