twipc_means: Simulation-Based Power Analysis for Two-Way Interaction Using...

Description Usage Arguments Value Examples

View source: R/twipc_means.R

Description

Estimate power for the interaction term in a 2 x 2 design. This function uses mean patterns to do so. It simulates data from normal distributions where the standard deviations are 1. This means that mean differences between cells can be interpreted in the units of Cohen's d. Thus, one can hypothesize a Cohens'd d in one condition, a Cohen's d in another condition, and then run simulations to estimate power at different sample sizes. See examples.

Usage

1
2
twipc_means(a1b1, a1b2, a2b1, a2b2, start = 100, end = 500, by = 25,
  alpha = 0.05, reps = 1000, verbose = FALSE)

Arguments

a1b1

Mean in cell A1, B1

a1b2

Mean in cell A1, B2

a2b1

Mean in cell A2, B1

a2b2

Mean in cell A2, B2

start

Smallest sample size N to test

end

Largest sample size N to test

by

The incrementing size from start to end

alpha

The alpha level for determining significance

reps

The number of times to repeat the simulations

verbose

Logical. Print out current status in the simulation?

Value

A data.frame containing columns indicating sample size and power at that sample size.

Examples

1
2
3
4
# imagine d = .5 in condition A and d = .0 in condition B
# try see what power is at 100, 150, and 200 N
set.seed(1839)
twipc_means(0, .5, 0, 0, 100, 200, 50)

markhwhiteii/twipc documentation built on Nov. 4, 2019, 5:25 p.m.