wp.modmed.m58 {WebPower}R Documentation

model58

Description

power analysis of model 58 in Introduction to Mediation, Moderation, and Conditional Process Analysis

Usage

wp.modmed.m58(
  c1,
  a1,
  c2,
  d1,
  b1,
  b2,
  cp,
  sige12,
  sige22,
  sigx_w,
  n,
  sigx2 = 1,
  sigw2 = 1,
  nrep = 1000,
  alpha = 0.05,
  b = 1000,
  nb = n,
  w_value = 0,
  power_method = "product",
  MCrep = 1000,
  ncore = 1,
  simulation_method = "percentile",
  pop.cov = NULL,
  mu = NULL,
  varnames = c("x", "w", "m", "xw", "mw", "y")
)

Arguments

c1

regression coefficient of outcome (m) on moderator (w)

a1

regression coefficient of mediator (m) on predictor (x)

c2

regression coefficient of outcome (m) on the product (xw)

d1

regression coefficient of outcome (y) on moderator (w)

b1

regression coefficient of outcome (y) on mediator (m)

b2

regression coefficient of outcome (y) on the product (mw)

cp

regression coefficient of outcome (y) on predictor (x)

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

number of replications for finding power

alpha

type 1 error rate

b

number of bootstrap iterations used when simulation method is "percentile"

nb

bootstrap sample size, default to n, used when simulation method is "percentile"

w_value

moderator level

power_method

"product" for using the indirect effect value in power calculation, or "joint" for using joint significance in power calculation

MCrep

number of repetitions used for finding distribution when simulation method is "MC"

ncore

number of cores to use, default is 1, when ncore > 1, parallel is used

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

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

Value

power of indirect effect, direct effect, and moderation

References

Xu, Z., Gao, F., Fa, A., Qu, W., & Zhang, Z. (2023). Statistical Power Analysis and Sample Size Planning for Moderated Mediation Models. Zhang, Z., & Yuan, K.-H. (2018). Practical Statistical Power Analysis Using Webpower and R (Eds). Granger, IN: ISDSA Press.

Examples


test = wp.modmed.m58(c1 = 0.2, a1 = 0.2, c2 = 0.1, b2 = 0.1,
     b1 = 0.2, cp = 0.2, d1 = 0.2, w_value = 0.3, simulation_method = "MC",
     sigx2 = 1, sigw2 = 1, sige12 = 1, sige22 = 1, sigx_w = 0.5,
     n = 50, nrep = 1000, alpha = 0.05, ncore = 1)
print(test)


[Package WebPower version 0.9.4 Index]