Learn R Programming

prw2ppl Readme

Chris Aberson April 2, 2021

pwr2ppl

pwr2ppl contains protocols for running a wide range of power analyses. Analyses range from simple approaches such as t-test and correlations to multifactor ANOVA (between and within subjects, linear mixed model approaches) and regression-based approaches (basic multiple regression, moderated regression, mediation, and logistic regression).

These protocols accompany the book Applied Power Analysis for the Behavioral Sciences (2nd ed.)

The book gives lots of illustrative examples of using the code but is not necessary for using the package.

Prerequisites

I built this under R 4.0.2

Authors

License

This project is licensed under the MIT License.

Copy Link

Version

Install

install.packages('pwr2ppl')

Monthly Downloads

310

Version

0.5.0

License

GPL (>= 2)

Maintainer

Chris Aberson

Last Published

September 6th, 2022

Functions in pwr2ppl (0.5.0)

MRC_shortcuts

Compute Multiple Regression shortcuts with three predictors (will expand to handle two to five) Requires correlations between all variables as sample size. Means and sds are option. Also computes Power(All)
R2_prec

Compute Precision Analyses for R-Squared This approach simply loops a function from MBESS
R2ch

Compute power for R2 change in Multiple Regression (up to three predictors) Requires correlations between all variables as sample size. Means, sds, and alpha are option. Also computes Power(All) Example code below for three predictors. Expand as needed for four or five
anova1f_4

Compute power for a One Factor Between Subjects ANOVA with four levels Takes means, sds, and sample sizes for each group
anova1f_4c

Compute power for a One Factor ANOVA with four levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
anova1f_3

Compute power for a One Factor ANOVA with three levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
MRC_short2

Compute Multiple Regression shortcuts with three predictors for Ind Coefficients Requires correlations between all variables as sample size. Means and sds are option. Also computes Power(All)
anc

Compute Power for One or Two Factor ANCOVA with a single covariate Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user Factor A can have up to four levels, Factor B, if used, can only be two
MRC_all

Compute power for Multiple Regression with Up to Five Predictors Requires correlations between all variables as sample size. Means, sds, and alpha are option. Also computes Power(All)
anova1f_3c

Compute power for a One Factor ANOVA with three levels and contrasts. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
depcorr0

Compute Power for Comparing Two Dependent Correlations, No Variables in Common Takes correlations and range of values. First variable in each pair is termed predictor, second is DV
anova2x2

Compute power for a Two by Two Between Subjects ANOVA. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
anova2x2_se

Compute power for Simple Effects in a Two by Two Between Subjects ANOVA with two levels for each factor. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
depb

Power for Comparing Dependent Coefficients in Multiple Regression with Two or Three Predictors Requires correlations between all variables as sample size. Means, sds, and alpha are option. Also computes Power(All)
depcorr1

Compute Power for Comparing Two Dependent Correlations, One Variable in Common Takes correlations and range of values
indR2

Power for Comparing Independent R2 in Multiple Regression with Two or Three Predictors Requires correlations between all variables as sample size. Means, sds, and alpha are option. Also computes Power(All)
corr

Compute power for Pearson's Correlation Takes correlation and range of values
d_prec

Compute Precision Analyses for Standardized Mean Differences
lmm2Fse

Compute power for a Two Factor Within Subjects Using Linear Mixed Models with up to two by four levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
lmm2F

Compute power for a Two Factor Within Subjects Using Linear Mixed Models with up to two by four levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
lmm1F

Compute power for a One Factor Within Subjects Linear Mixed Model with up to four levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
med

Compute Power for Mediated (Indirect) Effects Requires correlations between all variables as sample size. This approach calculates power for the Sobel test. The medjs function calculates power based on joint significance (recommended)
indt

Compute power for an Independent Samples t-test Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
md_prec

Compute Precision Analyses for Mean Differences
medjs

Compute Power for Mediated (Indirect) Effects Using Joint Significance Requires correlations between all variables as sample size. This is the recommended approach for determining power
lmm1w1b

Compute power for a One Factor Within Subjects and One Factor Between LMM with up to two by four levels (within). Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
lmm1Ftrends

Compute power for a One Factor Within Subjects LMM Trends with up to four levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
indb

Power for Comparing Independent Coefficients in Multiple Regression with Two or Three Predictors Requires correlations between all variables as sample size. Means, sds, and alpha are option. Also computes Power(All)
indcorr

Compute Power for Comparing Two Independent Correlations Takes correlations and range of values
medjs_paths

Compute Power for Mediated (Indirect) Effects Using Joint Significance Requires paths for all effects (and if 2 mediators, correlation) Standard deviations/variances set to 1.0 so paths are technically standardized
r_prec

Compute Precision Analyses for Correlations This approach simply loops a function from MBESS
propind

Compute power for Tests of Two Independent Proportions Takes phi, degrees of freedom, and a range of sample sizes. Alpha is .05 by default, alternative values may be entered by user This test uses what is sometimes called the chi-square test for comparing proportions
pairt

Compute power for a Paired t-test Takes means, sd, and sample sizes. Alpha is .05 by default, alternative values may be entered by user. correlation (r) defaults to .50.
prop1

Compute power for a single sample proportion test Takes phi, degrees of freedom, and a range of sample sizes. Alpha is .05 by default, alternative values may be entered by user
regint

Compute Power for Regression Interaction (Correlation/Coefficient Approach)
regintR2

Compute Power for Regression Interaction (R2 Change Approach)
modmed14

Compute Power for Conditional Process Model 14 Joint Significance Requires correlations between all variables as sample size. This is the recommended approach for determining power
modmed7

Compute Power for Model 7 Conditional Processes Using Joint Significance Requires correlations between all variables as sample size Several values default to zero if no value provided This is the recommended approach for determining power
medserial_paths

Compute Power for Serial Mediation Effects Requires correlations between all variables as sample size. This approach calculates power for the serial mediation using joint significance (recommended) and path coefficients
tfromd

Compute power for a t test using d statistic Takes d, sample size range, type of test, and tails.
win1bg1

Compute power for a One Factor Within Subjects and One Factor Between ANOVA with up to two by four levels (within). Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
win2F

Compute power for a Two Factor Within Subjects ANOVA with up to two by four levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
win2Fse

Compute power for Simple Effects in Two Factor Within Subjects ANOVA with up to two by four levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
win1Ftrends

Compute power for a One Factor Within Subjects Trends with up to four levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
win1F

Compute power for a One Factor Within Subjects ANOVA with up to four levels. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
medserial

Compute Power for Serial Mediation Effects Requires correlations between all variables as sample size. This approach calculates power for the serial mediation using joint significance (recommended)
Chi2X3

Compute power for an Chi Square 2x3 Takes proportions for each group. Alpha is .05 by default, alternative values may be entered by user
ChiES

Compute power for Chi Square Based on Effect Size Takes phi, degrees of freedom, and a range of sample sizes. Alpha is .05 by default, alternative values may be entered by user
ChiGOF

Compute power for an Chi Square Goodness of Fit Takes proportions for up to six group. Alpha is .05 by default, alternative values may be entered by user
Assumptions

Compute power for Multiple Regression with Violated assumptions (Beta)
MANOVA1f

Compute power for a One Factor MANOVA with up to two levels and up to four measures. Takes means, sds, and sample sizes for each group. Alpha is .05 by default, alternative values may be entered by user
LRcat

Compute Power for Logistic Regression with a Single Categorical Predictor
Assumptions_resample

Compute power for Multiple Regression with Violated assumptions using Resamples
LRcont

Compute Power for Logistic Regression with Continuous Predictors
Chi2x2

Compute power for an Chi Square 2x2 Takes proportions for each group. Alpha is .05 by default, alternative values may be entered by user
MRC

Compute power for Multiple Regression with up to Five Predictors Example code below for three predictors. Expand as needed for four or five