wp.modmed.m8 | R Documentation |
power analysis of model 8 in Introduction to Mediation, Moderation, and Conditional Process Analysis. Powers are obtained through either the percentile bootstrap method or the Monte Carlo method. The conditional indirect effect value is (a1 + c2w)b1; the conditional direct effect value is cp + d2w; the index of moderated mediation is c2b1.
wp.modmed.m8(
a1,
cp,
b1,
c1,
d1,
c2,
d2,
sige12,
sige22,
sigx_w,
n,
sigx2 = 1,
sigw2 = 1,
nrep_power = 1000,
alpha = 0.05,
b = 1000,
nb = n,
w_value = 0,
power_method = "product",
simulation_method = "percentile",
ncore = 1,
pop.cov = NULL,
mu = NULL,
varnames = c("y", "x", "w", "m", "xw")
)
a1 |
regression coefficient of mediator (m) on predictor (x) |
cp |
regression coefficient of outcome (y) on predictor (x) |
b1 |
regression coefficient of outcome (y) on mediator (m) |
c1 |
regression coefficient of mediator (m) on moderator (w) |
d1 |
regression coefficient of mediator (y) on moderator (w) |
c2 |
regression coefficient of mediator (m) on the product (xw) |
d2 |
regression coefficient of mediator (y) on the product (xw) |
sige12 |
variance of error in the first regression equation |
sige22 |
variance of error in the second regression equation |
sigx_w |
covariance between predictor (x) and moderator (w) |
n |
sample size |
sigx2 |
variance of predictor (x) |
sigw2 |
variance of moderator (w) |
nrep_power |
number of replications for finding power |
alpha |
type 1 error rate |
b |
number of bootstrap iterations |
nb |
bootstrap sample size, default to n, used when simulation method is "percentile" |
w_value |
moderator level, value of w |
power_method |
"product" for using the indirect effect value in power calculation, or "joint" for using joint significance in power calculation |
simulation_method |
"percentile" for using percentile bootstrap CI in finding significance of mediation, or "MC" for using Monte Carlo CI in finding significance of mediation |
ncore |
number of cores to use for the percentile bootstrap method, default is 1, when ncore > 1, parallel is used |
pop.cov |
covariance matrix, default to NULL if using the regression coefficient approach |
mu |
mean vector, default to NULL if using the regression coefficient approach |
varnames |
name of variables for the covariance matrix |
power of indirect effect, direct effect, moderation, and the index of moderated mediation
# usage of wp.modmed.m8
test = wp.modmed.m8(a1 = 0.2, cp = 0.2, b1 = 0.2,
c1 = 0.2, d1=0.2, c2 = 0.2, d2 = 0.2,
sigx2 = 1, sigw2 = 1, sige12 = 1, sige22 = 1, sigx_w = 0.5,
simulation_method = "MC",
n = 50, nrep_power = 1000, alpha = 0.05, ncore = 1)
print(test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.