Power for regression (or any continuous outcome)
Usage
rpower(rsq, n, k = 1, p = k, alpha = 0.05)
rsamsize(rsq, k = 1, p = k, power = 0.8, alpha = 0.05)
rpower_beta(rsq, beta)
Arguments
- rsq
Fraction of variance explained by the features to be tested
- n
Sample size
- k
Number of parameters to test
- p
Number of parameters in model (default: k)
- alpha
Type 1 error rate
- power
Desired power
- beta
Beta coefficient
Examples
rpower(0.05, 40)
#> [1] 0.2812148
rpower(0.05, 40, 5)
#> [1] 0.1398391
rpower(0.05, 40, 5, 20)
#> [1] 0.1297087
rpower(0.05, 40, 5, 20)
#> [1] 0.1297087
rsamsize(0.05)
#> [1] 159
rpower_beta(0.1)
#> [1] 0.3333333
rpower_beta(beta=0.13)
#> [1] 0.01661914