powr: Estimation of power for unpaired and paired t-test.

Description Usage Arguments Value Examples

View source: R/powr.R

Description

Estimates the power of paired and unpaired t-test in the case of normal data for a given intra-pair correlation, significance level, sample size and effect size.

Usage

1
powr(npairs = NULL, eff = NULL, rho = NULL, sig = 0.05, rounds = 10000)

Arguments

npairs

integer. Supplies the number of pairs to be simulated. Resulting in two samples of size "npairs".

eff

numeric. Supplies the difference in means between both groups. Can be interpreted as effect size based on the fact that standard normal variates are the basis of simulation.

rho

numeric. Supplies the correlation coefficient between both groups.

sig

numeric. Supplies the significance level for the test. 0.05 by default.

rounds

integer. Supplies the number of simulation to base the power estimation on. Set to 10000 by default.

Value

Returns the estimated power for both tests as a vector containing the power of the unpaired t-test in the first place.

Examples

1
2
powertest <- powr(npairs = 10, eff = 0.5, rho = 0.1)
powertest

AlexanderRitz/pairedpowR documentation built on March 16, 2020, 12:16 a.m.