Description Usage Arguments Details Value Author(s) References Examples
View source: R/figure.relative.power.R
Contour plot of relative power of mediated effect versus total effect in the absence of direct effect and relative power of mediated effect versus direct effect when ab=c'.
1 2 | figure.relative.power(comparison = "mediated2main", n = 100,
sig.level = 0.05, grid.size = 0.01)
|
comparison |
a character string specifying the relative power to be
plotted. One of |
n |
sample size |
sig.level |
significance level used for the test of the mediated effect |
grid.size |
grid size for a^2 and b^2 |
Basic three-factor mediation model is assumed. Coefficients are standardized such
that the variances of treatment, mediator, and outcome are equal to 1. Note
that the y-axis is a^2 and the x-axis is b^2. The default axes
labels from R function plot_ly
are switched in order to make them
correct.
A plot generated using package plotly
Kai Wang <kai-wang@uiowa.edu>
Wang, K. (2018) Understanding power anomalies in mediation analysis. Psychometrika 83 (2), 387-406.
1 2 | ## figure.relative.power() # Figure 2 of Wang (2018)
## figure.relative.power(comparison="mediated2direct") # Figure 3 of Wang (2018)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.