**Navigation**

manual:modmed15

X is the predictor and Y is the dependent variable . Variable X’s effect on a second variable Y is said to be mediated by a third variable M if X causally influences M and M in turn causally influences Y, and then M is the mediator in the model.

A variable’s effect on another is moderated if its size depends on a third variable—a moderator. W is the moderator in the model. The conditional indirect process model:

$$ M=i_{M}+a_{1}X $$

The conditional direct model:

$$ Y=i_{Y}+c'X+b_{1}M+c_{1}W+c_{2}XW+b_{2}MW $$

XW is the product of X and W. MW is the product of M and W. If W moderates X’s effect on Y, it is said that X and W interact in their influence on Y. It’s same to M and W. Equation above can be written in an equivalent form as

$$ Y=i_{Y}+(c'+c_{2}W)X+(b_{1}+b_{2}W)M+c_{1}W $$

In the model, Conditional direct effect of X on Y is $(c'+c_{2}W)$, conditional indirect effect of X on Y through M is $a_{1}(b_{1}+b_{2}W)$.

In the power analysis, we use Monte Carlo simulation by assuming all variables are normally distributed. We require the input of the correlations between X,W,M,XW,MW,Y. Based on the correlation matrix, $R$ sets of data are randomly generated from a multivariate normal distribution. For each set of data, least squares regression is used to get the parameter estimates and the associated test of significance.

The result of Power for Conditional Indirect Effect (On Mediator) and Power for Conditional Indirect Effect (On Mediator) is computed by the following formulas:

$$ \begin{align*} \mathrm{JSa}&=\frac{\text{times of }a_{1}\text{ and }c_{2}\text{ passes the test}}{\text{ times of the simulation}}\\ \mathrm{JSa}&=\frac{\text{times of }a_{1}\text{ and }b_{2}\text{ passes the test}}{\text{ times of the simulation}} \end{align*} $$

We developed a web app based on modmed15 function in the pwr2ppl package. The input of the web app include the following:

- Sample Size
- Significance Level(alpha): the default value is 0.05.
- Number of Simulations: How many Monte Carlo simulations are used for power calculation. The default is 5000. A larger number will need more calculation time.
- Correlation between predictor and moderator($r_{x,w}$)
- Correlation between predictor and mediator($r_{x,m}$)
- Correlation between predictor and interaction ($r_{x,mw}$)
- Correlation between DV and predictor($r_{y,x}$)
- Correlation between moderator and mediator($r_{w,m}$)
- Correlation between mediator and interaction($r_{m,mw}$)
- Correlation between moderator and interaction($r_{w,xw}$)
- Correlation between DV and moderator($r_{y,w}$)
- Correlation between mediator and interaction($r_{m,wm}$)
- Correlation between mediator and interaction($r_{m,xw}$)
- Correlation between DV and interaction($r_{y,mw}$)
- Correlation between DV and interaction($r_{y,xw}$)
- Correlation between DV and mediator($r_{y,m}$)
- Correlation between moderator and interaction($r_{w,xw}$)
- Correlation between inteaction and interaction($r_{xw,mw}$)

- Chris Aberson (2021). pwr2ppl: Power Analyses for Common Designs (Power to the People). R package version 0.2.0. https://CRAN.R-project.org/package=pwr2ppl.
- Aberson, C. L. (2019). Applied power analysis for the behavioral sciences. Routledge.

manual/modmed15.txt · Last modified: 2021/12/23 00:43 by Anqi