pamlmed.RdPower analysis for simple and multiple mediation models using the Sobel test, joint-significance, or bootstrap confidence intervals.
pamlmed(
aim = "n",
mode = "medsimple",
a = 0.3,
b = 0.3,
cprime = 0,
model_type = "twomeds",
a1 = "",
b1 = "",
a2 = "",
b2 = "",
a3 = "",
b3 = "",
d1 = "",
d2 = "",
r12 = "",
r13 = "",
r23 = "",
cprime2 = 0,
sensitivity_coef = "a1",
power = 0.9,
n = 100,
sig.level = 0.05,
alternative = "two.sided",
test = "joint",
mcR = 1000,
parallel = FALSE,
set_seed = FALSE,
seed = 42,
table_pwbyn = TRUE,
table_pwbyes = FALSE,
plot_ncurve = FALSE,
plot_log = FALSE,
plot_palette = "viridis",
plot_x = "none",
plot_y = "none",
plot_custom_labels = FALSE,
plot_z = "none",
plot_x_from = 0,
plot_x_to = 0,
plot_z_lines = 1,
plot_z_value = list(),
plot_to_table = FALSE,
test_c = FALSE,
explain = FALSE,
diagram = TRUE
)The aim of the analysis: n (default) for sample size,
power to estimate power, es for effect size (correlation)
Mediation model mode: "medsimple" for simple mediation
with paths a, b, and cprime, or "medcomplex"
for multiple/serial mediator models.
The expected standardized effect of the independent variable on the mediator
The expected standardized effect of the independent variable on the mediator
The expected standardized effect of the independent variable on the mediator
Type of complex mediation model when
mode="medcomplex": "twomeds" for two parallel mediators,
"threemeds" for three parallel mediators, or
"twoserial" for a two-mediator serial model.
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on mediator 1
The expected standardized effect of the independent variable on the mediator
For complex mediation models with the effect-size
aim, the path coefficient ("a1", "b1", "d1", ...) that
is resized to find the minimum detectable indirect effect.
Minimal desired power
Sample size
Type I error rate (significance cut-off or alpha)
Test direction: "two.sided" (default) or
"one.sided".
Mediation test method: "sobel", "joint" for
joint-significance, or the Monte Carlo confidence-interval methods
"parametric" and "simulation" (both approximate bootstrap-CI
power for the indirect effect).
Number of simulated studies used by the Monte Carlo CI methods.
Logical; if TRUE, use parallel computation for
simulation-based methods when available.
Logical; if TRUE, use the value in seed to
make simulations reproducible.
Random seed used when set_seed=TRUE.
Logical; if TRUE, produce the "Power by Sample
size" table.
Logical; if TRUE, produce the "Power by Effect
Size" table: the indirect effect and the value of the varied coefficient
reaching power .5/.8/.95 at the analysis sample size.
Logical; if TRUE, produce the power-by-n
curve.
Logical; if TRUE, use a log scale where supported in
plots.
Color palette used for plots.
Parameter shown on the X axis of the custom power plot.
Parameter shown on the Y axis of the custom power plot.
Logical; if TRUE, add value labels to the
custom plot.
Parameter used to split the custom power plot into multiple lines or conditions.
Lower bound of the X-axis parameter range for the custom power plot.
Upper bound of the X-axis parameter range for the custom power plot.
Number of reference lines or levels to use for
plot_z in the custom plot.
Explicit values of the plot_z parameter to use in
the custom plot.
Logical; if TRUE, output the plotted custom
power values as a table.
Logical; if TRUE, also compute the power analysis for
the direct X -> Y effect (c path) without mediators.
Logical; if TRUE, include explanatory output where
available.
Logical; if TRUE, display the mediation path diagram.
Used for internal purposes
Used for internal purposes
A results object containing:
results$intro | a html | ||||
results$extrainfo | a html | ||||
results$issues | a html | ||||
results$initnotes | a html | ||||
results$diagram | an image | ||||
results$powertab | a table | ||||
results$effectsize | a table | ||||
results$powerbyn | a table | ||||
results$powerxy | a table | ||||
results$plotnotes | a html | ||||
results$powerNcurve | an image | ||||
results$powerCustom | an image | ||||
results$customnotes | a html | ||||
results$customtable | a table |
Tables can be converted to data frames with asDF or as.data.frame. For example:
results$powertab$asDF
as.data.frame(results$powertab)