boot_pb_med_simple: Parametric Bootstrap (Simple Mediation Model)

Description Usage Arguments Value Author(s) See Also Examples

View source: R/boot.R

Description

Generates B number of parametric bootstrap resamples from the original sample data generated fitted with the simple mediation model, M_i = δ_M + α X_i + ε_{M_i} and Y_i = δ_Y + τ^{\prime} X_i + β M_i + ε_{Y_i}. The user can specify the distribution and parameters of X. Variables M and Y are generated using values of variable X and parameters provided assuming that the residuals are normally distributed with a mean of 0 and a given variance.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
boot_pb_med_simple(
  n,
  alpha,
  tau_prime,
  beta,
  delta_M,
  delta_Y,
  sigma2_epsilon_M,
  sigma2_epsilon_Y,
  B = 2000,
  rFUN_X,
  X_args
)

Arguments

n

Sample size.

alpha

Path from X to M (α).

tau_prime

Path from X to Y (τ^{\prime}).

beta

Path from M to Y (β).

delta_M

Intercept for the first equation (δ_M).

delta_Y

Intercept for the second equation (δ_Y).

sigma2_epsilon_M

Variance of ε_M (σ^{2}_{ε_{M}}).

sigma2_epsilon_Y

Variance of ε_Y (σ^{2}_{ε_{Y}}).

B

Number of bootstrap resamples.

rFUN_X

The distribution function used to generate values of \mathbf{X}. The default value is rnorm for the Gaussian probability density function.

X_args

List of arguments to pass to rFUN_X.

Value

Returns a list of parametric bootstrap resamples.

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other bootstrap functions: boot_fit(), boot_lav(), boot_nb(), boot_pb_vm(), boot_pb()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
n <- 100
alpha <- 0.26^(1 / 2)
tau_prime <- 0
beta <- 0.26^(1 / 2)
delta_M <- delta_Y <- 0
sigma2_epsilon_M <- 1 - alpha^2
sigma2_epsilon_Y <- 1 - beta^2 - tau_prime^2 - 2 * alpha * beta * tau_prime
B <- 5
rFUN_X <- rnorm
X_args <- list(mean = 0, sd = 1)

jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.