Skip to contents

The sampling distribution of the product ab is skewed, so the Sobel normal approximation is wrong in finite samples; the remedy is to resample cases with replacement, recompute ab in each resample and read the interval off the empirical percentiles. The fitted equations are M = i1 + a X and \(Y = i2 + c' X + b M\), so the total effect \(c = c' + ab\) is an exact least-squares identity in the single-mediator case. The resampling stream is a deterministic linear congruential generator, not a system RNG, so both language arms draw the same case indices.

Usage

Dssoot(Y, X, M, n_boot = 1000L, alpha = 0.05, seed = 42L)

Arguments

Y

Outcome.

X

Independent variable.

M

Mediator.

n_boot

Number of bootstrap resamples, at least 1.

alpha

Two-sided level of the percentile interval.

seed

Seed of the deterministic congruential stream.

Value

List with estimate, a, b, c_prime, c_total, ci_lo, ci_hi, se_boot, bias, n_boot, alpha, n.

References

Preacher, K. J. and Hayes, A. F. (2008). Asymptotic and resampling strategies for assessing and comparing indirect effects in multiple mediator models. Behavior Research Methods 40(3), 879-891.

Examples

Dssoot(Y = c(1, 2, 3, 4, 5, 6, 7, 8), X = c(1, 2, 3, 4, 5, 6, 7, 8), M = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] 0.5
#> 
#> $a
#> [1] 1
#> 
#> $b
#> [1] 0.5
#> 
#> $c_prime
#> [1] 0.5
#> 
#> $c_total
#> [1] 1
#> 
#> $ci_lo
#> [1] 0.4999645
#> 
#> $ci_hi
#> [1] 0.5000355
#> 
#> $se_boot
#> [1] 2.373745e-05
#> 
#> $bias
#> [1] -8.884572e-08
#> 
#> $n_boot
#> [1] 1000
#> 
#> $alpha
#> [1] 0.05
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Bootstrap CI for indirect effect ab"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"