compute_dmod_npar {psychmeta}R Documentation

Function for computing non-parametric dModd_{Mod} effect sizes for a single focal group

Description

This function computes non-parametric dModd_{Mod} effect sizes from user-defined descriptive statistics and regression coefficients, using a distribution of observed scores as weights. This non-parametric function is best used when the assumption of normally distributed predictor scores is not reasonable and/or the distribution of scores observed in a sample is likely to represent the distribution of scores in the population of interest. If one has access to the full 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_npar(
  referent_int,
  referent_slope,
  focal_int,
  focal_slope,
  focal_x,
  referent_sd_y
)

Arguments

referent_int

Referent group's intercept.

referent_slope

Referent group's slope.

focal_int

Focal group's intercept.

focal_slope

Focal group's slope.

focal_x

Focal group's vector of predictor scores.

referent_sd_y

Referent group's criterion standard deviation.

Details

The dModSignedd_{Mod_{Signed}} effect size (i.e., the average of differences in prediction over the range of predictor scores) is computed as

dModSigned=i=1mni[Xi(b11b12)+b01b02]SDY1i=1mni,d_{Mod_{Signed}}=\frac{\sum_{i=1}^{m}n_{i}\left[X_{i}\left(b_{1_{1}}-b_{1_{2}}\right)+b_{0_{1}}-b_{0_{2}}\right]}{SD_{Y_{1}}\sum_{i=1}^{m}n_{i}},

where

The dModUnderd_{Mod_{Under}} and dModOverd_{Mod_{Over}} effect sizes are computed using the same equation as dModSignedd_{Mod_{Signed}}, but dModUnderd_{Mod_{Under}} is the weighted average of all scores in the area of underprediction (i.e., the differences in prediction with negative signs) and dModOverd_{Mod_{Over}} is the weighted average of all scores in the area of overprediction (i.e., the differences in prediction with negative signs).

The dModUnsignedd_{Mod_{Unsigned}} effect size (i.e., the average of absolute differences in prediction over the range of predictor scores) is computed as

dModUnsigned=i=1mniXi(b11b12)+b01b02SDY1i=1mni.d_{Mod_{Unsigned}}=\frac{\sum_{i=1}^{m}n_{i}\left|X_{i}\left(b_{1_{1}}-b_{1_{2}}\right)+b_{0_{1}}-b_{0_{2}}\right|}{SD_{Y_{1}}\sum_{i=1}^{m}n_{i}}.

The dMind_{Min} effect size (i.e., the smallest absolute difference in prediction observed over the range of predictor scores) is computed as

dMin=1SDY1Min[X(b11b12)+b01b02].d_{Min}=\frac{1}{SD_{Y_{1}}}Min\left[\left|X\left(b_{1_{1}}-b_{1_{2}}\right)+b_{0_{1}}-b_{0_{2}}\right|\right].

The dMaxd_{Max} effect size (i.e., the largest absolute difference in prediction observed over the range of predictor scores)is computed as

dMax=1SDY1Max[X(b11b12)+b01b02].d_{Max}=\frac{1}{SD_{Y_{1}}}Max\left[\left|X\left(b_{1_{1}}-b_{1_{2}}\right)+b_{0_{1}}-b_{0_{2}}\right|\right].

Note: When dMind_{Min} and dMaxd_{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.

Value

A vector of effect sizes (dModSignedd_{Mod_{Signed}}, dModUnsignedd_{Mod_{Unsigned}}, dModUnderd_{Mod_{Under}}, dModOverd_{Mod_{Over}}), proportions of under- and over-predicted criterion scores, minimum and maximum differences (i.e., dModUnderd_{Mod_{Under}} and dModOverd_{Mod_{Over}}), and the scores associated with minimum and maximum differences.

Examples

# Generate some hypothetical data for a referent group and three focal groups:
set.seed(10)
refDat <- MASS::mvrnorm(n = 1000, mu = c(.5, .2),
                        Sigma = matrix(c(1, .5, .5, 1), 2, 2), empirical = TRUE)
foc1Dat <- MASS::mvrnorm(n = 1000, mu = c(-.5, -.2),
                         Sigma = matrix(c(1, .5, .5, 1), 2, 2), empirical = TRUE)
foc2Dat <- MASS::mvrnorm(n = 1000, mu = c(0, 0),
                         Sigma = matrix(c(1, .3, .3, 1), 2, 2), empirical = TRUE)
foc3Dat <- MASS::mvrnorm(n = 1000, mu = c(-.5, -.2),
                         Sigma = matrix(c(1, .3, .3, 1), 2, 2), empirical = TRUE)
colnames(refDat) <- colnames(foc1Dat) <- colnames(foc2Dat) <- colnames(foc3Dat) <- c("X", "Y")

# Compute a regression model for each group:
refRegMod <- lm(Y ~ X, data.frame(refDat))$coef
foc1RegMod <- lm(Y ~ X, data.frame(foc1Dat))$coef
foc2RegMod <- lm(Y ~ X, data.frame(foc2Dat))$coef
foc3RegMod <- lm(Y ~ X, data.frame(foc3Dat))$coef

# Use the subgroup regression models to compute d_mod for each referent-focal pairing:

# Focal group #1:
compute_dmod_npar(referent_int = refRegMod[1], referent_slope = refRegMod[2],
             focal_int = foc1RegMod[1], focal_slope = foc1RegMod[2],
             focal_x = foc1Dat[,"X"], referent_sd_y = 1)

# Focal group #2:
compute_dmod_npar(referent_int = refRegMod[1], referent_slope = refRegMod[2],
             focal_int = foc2RegMod[1], focal_slope = foc1RegMod[2],
             focal_x = foc2Dat[,"X"], referent_sd_y = 1)

# Focal group #3:
compute_dmod_npar(referent_int = refRegMod[1], referent_slope = refRegMod[2],
             focal_int = foc3RegMod[1], focal_slope = foc3RegMod[2],
             focal_x = foc3Dat[,"X"], referent_sd_y = 1)

[Package psychmeta version 2.7.0 Index]