prob.randomizationSuccess computes the probability that two groups are equivalent given a specific sample size, number of nuisance variables, and definition of 'equivalence' (in terms of the Cohen's d expressing the maximum acceptable difference between the groups on any of the nuisance variables).

pwr.randomizationSuccess computes the sample size required to make randomization succeed in a specified proportion of the studies with a two-cell design. 'Success' is defined as the two groups differing at most with a specified effect size on any of a given number or nuisance variables.

prob.randomizationSuccess(n = 1000,
                          dNonequivalence = .2,
                          nNuisanceVars = 100)
pwr.randomizationSuccess(dNonequivalence = 0.2,
                         pRandomizationSuccess = 0.95,
                         nNuisanceVars = 100)

Arguments

n

The sample size.

dNonequivalence

The maximum difference between the two groups that is deemed acceptable.

pRandomizationSuccess

The desired probability that the randomization procedure succeeded in generating two equivalent groups (i.e. differing at most with dNonequivalence).

nNuisanceVars

The number of nuisance variables that the researchers assumes exists.

Details

For more details, see Peters & Gruijters (2017).

Value

For prob.randomizationSuccess, the probability that the two groups are equivalent. The function is vectorized, so returns either a vector of length one, a vector of length > 1, a matrix, or an array.

For pwr.randomizationSuccess, the required sample size. The function is vectorized, so returns either a vector of length one, a vector of length > 1, a matrix, or an array.

References

Peters, G. J.-Y. & Gruijters, S. Why your experiments fail: sample sizes required for randomization to generate equivalent groups as a partial solution to the replication crisis (2017). http://dx.doi.org/

See also

Examples

### To be on the safe side: sample size required to ### obtain 95% likelihood of success when assuming ### 100 nuisance variables exist. pwr.randomizationSuccess(dNonequivalence = 0.2, pRandomizationSuccess = 0.95, nNuisanceVars = 100);
#> [1] 1212
### Living on the edge: pwr.randomizationSuccess(dNonequivalence = 0.2, pRandomizationSuccess = 0.60, nNuisanceVars = 10);
#> [1] 386
### For those with quite liberal ideas of 'equivalence': pwr.randomizationSuccess(dNonequivalence = 0.5, pRandomizationSuccess = 0.95, nNuisanceVars = 100);
#> [1] 198
### And these results can be checked with ### prob.randomizationSuccess: prob.randomizationSuccess(1212, .2, 100);
#> [1] 0.9501563
prob.randomizationSuccess(386, .2, 10);
#> [1] 0.6013712
prob.randomizationSuccess(198, .5, 100);
#> [1] 0.9504771
### Or in one go: prob.randomizationSuccess(n=c(198, 386, 1212), c(.2, .5), c(10, 100));
#> , , Nonequival. at: d= 0.2 #> #> N: 198 N: 386 N: 1212 #> Nuisance var: 10 1.772353e-01 0.60137117 0.9949002 #> Nuisance var: 100 3.058448e-08 0.00618623 0.9501563 #> #> , , Nonequival. at: d= 0.5 #> #> N: 198 N: 386 N: 1212 #> Nuisance var: 10 0.9949338 0.9999874 1 #> Nuisance var: 100 0.9504771 0.9998741 1 #>