Package: power4mome 0.2.1.5

power4mome: Power Analysis for Moderation and Mediation

Power analysis and sample size determination for moderation, mediation, and moderated mediation in models fitted by structural equation modelling using the 'lavaan' package by Rosseel (2012) <doi:10.18637/jss.v048.i02> or by multiple regression. The package 'manymome' by Cheung and Cheung (2024) <doi:10.3758/s13428-023-02224-z> is used to specify the indirect paths or conditional indirect paths to be tested.

Authors:Shu Fai Cheung [aut, cre], Sing-Hang Cheung [aut], Wendie Yang [aut]

power4mome_0.2.1.5.tar.gz
power4mome_0.2.1.5.zip(r-4.7)power4mome_0.2.1.5.zip(r-4.6)power4mome_0.2.1.5.zip(r-4.5)
power4mome_0.2.1.5.tgz(r-4.6-any)power4mome_0.2.1.5.tgz(r-4.5-any)
power4mome_0.2.1.5.tar.gz(r-4.7-any)power4mome_0.2.1.5.tar.gz(r-4.6-any)
power4mome_0.2.1.5.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
power4mome/json (API)

# Install 'power4mome' in R:
install.packages('power4mome', repos = c('https://sfcheung.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/sfcheung/power4mome/issues

Pkgdown/docs site:https://sfcheung.github.io

On CRAN:

Conda:

lavaanmediationmoderated-mediationmoderationpower-analysissample-sizesemstructural-equation-modeling

6.16 score 1 stars 65 scripts 495 downloads 50 exports 84 dependencies

Last updated from:b2cf8ca49d. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK363
source / vignettesOK289
linux-release-x86_64OK341
macos-release-arm64OK259
macos-oldrel-arm64OK276
windows-develOK325
windows-releaseOK348
windows-oldrelOK312
wasm-releaseOK159

Exports:arg_x_from_poweras.power4test_by_esas.power4test_by_ncut_patternsdo_testfind_par_namesfit_modelgen_bootgen_mcmissing_valuesmodel_matrices_popn_from_powern_region_from_powerordinal_variablespba_diagnosispool_sim_datapop_es_yamlpower_curvepower4testpower4test_by_espower4test_by_nptable_popq_power_mediationq_power_mediation_parallelq_power_mediation_serialq_power_mediation_simpleR_for_bzrbeta_rsrbeta_rs2rbinary_rsrejection_ratesrexp_rsrlnorm_rsrpgnorm_rsRs_bz_supportedrt_rsrunif_rsscale_scoressim_datasim_outsummarize_teststest_cond_indirecttest_cond_indirect_effectstest_group_equaltest_index_of_mometest_indirect_effecttest_k_indirect_effectstest_moderationtest_parametersx_from_power

Dependencies:backportsbitbit64bootbroomclicliprcodetoolscpp11crayondplyrfarverforcatsforeachgenericsggplot2glmnetglueGPArotationgtablehavenhmsigraphisobanditeratorsjomolabelinglatticelavaanlifecyclelme4lmhelprsmagrittrmanymomeMASSMatrixmiceminqamitmlmnormtnlmenloptrnnetnumDerivordinalpanpbapplypbivnormpgnormpillarpkgconfigprettyunitsprogresspsychpurrrquadprogR6rbibutilsRColorBrewerRcppRcppEigenRdpackreadrreformulasrlangrpartS7scalessemToolsshapestringistringrsurvivaltibbletidyrtidyselecttzdbucminfutf8vctrsviridisLitevroomwithryaml

Power Analysis for Latent Variable Mediation
Introduction | Prerequisite | Scope | Package | Workflow | Mediation | Specify the Population Model | Specify The Population Values | Specify the Measurement Part | Call power4test() to Check the Model | Call power4test() to Do the Target Test | Compute the Power | Repeat a Simulation With A Different Sample Size | Repeat a Simulation With Different Numbers of Indicators or Reliability | Find the Sample Size With Desired Power | Using n_region_from_power() | Using power4test_by_n() | Using x_from_power() | Other Scenarios | References

Last update: 2026-03-10
Started: 2025-05-30

Power Analysis for Moderation, Mediation, and Moderated Mediation
Introduction | Prerequisite | Scope | Package | Workflow | Mediation | Specify the Population Model | Specify The Population Values | Call power4test() to Check the Model | Call power4test() to Do the Target Test | Compute the Power | Moderation | Specify the Population Model and Values | Call power4test() to Test The Moderation Effect | Moderated mediation | Specify the Population Model and Values | Call power4test() to Test The Moderated Mediation Effect | Repeating a Simulation With A Different Sample Size | Find the Sample Size With The Desired Power | Using n_region_from_power() | Using power4test_by_n() | Using x_from_power() | Other Advanced Features | Limitations | References

Last update: 2026-03-10
Started: 2025-02-22

Readme and manuals

Help Manual

Help pageTopics
Helpers for the Boos-and-Zhang (2000) Methodbz_helpers Rs_bz_supported R_for_bz
Do a Test on Each Replicationdo_test
Fit a Model to a List of Datasetsfit_model
Generate Bootstrap Estimatesgen_boot
Generate Monte Carlo Estimatesgen_mc
Process Data by Generating Missing Valuesmissing_values
Process Data by Creating Ordinal Variablescut_patterns ordinal_variables
Plot a Power Curveplot.power4test_by_es plot.power4test_by_n plot.power_curve
Plot The Results of 'x_from_power'plot.n_region_from_power plot.x_from_power
Parse YAML-Stye Values For 'pop_es'pop_es_yaml
Power Curvepower_curve print.power_curve
Estimate the Power of a Testpower4test print.power4test
Power By Effect Sizesas.power4test_by_es c.power4test_by_es power4test_by_es print.power4test_by_es
Power By Sample Sizesas.power4test_by_n c.power4test_by_n power4test_by_n print.power4test_by_n
Predict Method for a 'power_curve' Objectpredict.power_curve
Generate the Population Modelmodel_matrices_pop ptable_pop
All-in-One Power Estimation For Mediation Modelsplot.q_power_mediation print.q_power_mediation q_power_mediation q_power_mediation_parallel q_power_mediation_serial q_power_mediation_simple summary.q_power_mediation
Random Variable From a Beta Distributionrbeta_rs
Random Variable From a Beta Distribution (User Range)rbeta_rs2
Random Binary Variablerbinary_rs
Rejection Ratesprint.rejection_rates_df rejection_rates rejection_rates.default rejection_rates.n_region_from_power rejection_rates.power4test rejection_rates.power4test_by_es rejection_rates.power4test_by_n rejection_rates.q_power_mediation rejection_rates.x_from_power
Random Variable From an Exponential Distributionrexp_rs
Random Variable From a Lognormal Distributionrlnorm_rs
Random Variable From a Generalized Normal Distributionrpgnorm_rs
Random Variable From a t Distributionrt_rs
Random Variable From a Uniform Distributionrunif_rs
Process Data by Computing Scale Scoresscale_scores
Simulate Datasets Based on a Modelpool_sim_data print.sim_data sim_data
Create a 'sim_out' Objectprint.sim_out sim_out
Summarize Test Resultsprint.test_out_list print.test_summary print.test_summary_list summarize_tests
Summarize 'x_from_power' Resultsprint.summary.n_region_from_power print.summary.x_from_power summary.n_region_from_power summary.x_from_power
Test a Conditional Indirect Effecttest_cond_indirect
Test Several Conditional Indirect Effectstest_cond_indirect_effects
Test Group Constraintstest_group_equal
Test a Moderated Mediation Effecttest_index_of_mome
Test an Indirect Effecttest_indirect_effect
Test Several Indirect Effectstest_k_indirect_effects
Test All Moderation Effectstest_moderation
Test All Free Parametersfind_par_names test_parameters
Sample Size and Effect Size Determinationarg_x_from_power n_from_power n_region_from_power pba_diagnosis print.n_region_from_power print.x_from_power x_from_power