Jackknife Estimates of Indirect Effect for a Simple Mediation Model

jack(
  data,
  std = FALSE,
  complete = TRUE,
  par = TRUE,
  ncores = NULL,
  blas_threads = TRUE,
  mc = TRUE,
  lb = FALSE
)

Arguments

data

n by 3 matrix or data frame. data[, 1] correspond to values for x. data[, 2] correspond to values for m. data[, 3] correspond to values for y.

std

Logical. Standardize the indirect effect \( \hat{\alpha}^{\prime} \hat{\beta}^{\prime} = \hat{\alpha} \hat{\beta} \frac{\hat{\sigma}_x}{\hat{\sigma}_y}\).

complete

Logical. If TRUE, create complete data set before bootstrapping. If 'FALSE`' bootstrap incomplete data set and fit the model with FIML.

par

Logical. If TRUE, use multiple cores. If FALSE, use lapply().

ncores

Integer. Number of cores to use if par = TRUE. If unspecified, defaults to detectCores() - 1.

blas_threads

Logical. If TRUE, set BLAS threads using blas_set_num_threads(threads = blas_get_num_procs()). If FALSE, set BLAS threads using blas_set_num_threads(threads = 1). If par = TRUE, blas_threads is automatically set to FALSE to prevent conflicts in parallel processing. This argument is useful when FUN can handle implicit parallelism when par = FALSE, for example linear algebra operations.

mc

Logical. If TRUE, use parallel::mclapply(). If FALSE, use parallel::parLapply() or parallel::parLapplyLB(). Ignored if par = FALSE.

lb

Logical. If TRUE use parallel::parLapplyLB(). If FALSE, use parallel::parLapply(). Ignored if par = FALSE and mc = TRUE.

See also

Author

Ivan Jacob Agaloos Pesigan

Examples

data <- jeksterslabRdatarepo::thirst jack(data, par = FALSE)
#> [1] 0.1589380 0.1528989 0.1497859 0.1620022 0.1537431 0.1667747 0.1556082 #> [8] 0.1396859 0.1511013 0.1390319 0.1502809 0.1563733 0.1396859 0.1429076 #> [15] 0.1429076 0.1458415 0.1511013 0.1502228 0.1645387 0.1537431 0.1727872 #> [22] 0.1703545 0.1282251 0.1479033 0.1511130 0.1527138 0.1535299 0.1529155 #> [29] 0.1693498 0.1527210 0.1390278 0.1620022 0.1689067 0.1381531 0.1528989 #> [36] 0.1438568 0.1508277 0.1583010 0.1527210 0.1689510 0.1628900 0.1589380 #> [43] 0.1479033 0.1443555 0.1556082 0.1563733 0.1479033 0.1511130 0.1457809 #> [50] 0.1458415
jack(data, std = TRUE, par = FALSE)
#> [1] 0.1592976 0.1524529 0.1484713 0.1623688 0.1532947 0.1691903 0.1542426 #> [8] 0.1435778 0.1520844 0.1361895 0.1516697 0.1565773 0.1435778 0.1461303 #> [15] 0.1461303 0.1479539 0.1520844 0.1527076 0.1611749 0.1532947 0.1730126 #> [22] 0.1704124 0.1190541 0.1480962 0.1525094 0.1537074 0.1538773 0.1522152 #> [29] 0.1678635 0.1530666 0.1445440 0.1623688 0.1736129 0.1443809 0.1524529 #> [36] 0.1445133 0.1471212 0.1588250 0.1530666 0.1647535 0.1569296 0.1592976 #> [43] 0.1480962 0.1448334 0.1542426 0.1565773 0.1480962 0.1525094 0.1458305 #> [50] 0.1479539