Arguments

Var1mean

Variable 1 mean

Var2mean

Variable 2 mean

Var1sd

Variable 1 standard deviation

Var2sd

Variable 2 standard deviation

Var1samplesize

Variable 1 sample size

Var2samplesize

Variable 2 sample size

nsim

Number of simulations

alphalevel

alpha-level (default=0.05)

Details

First, you will need to simulate two normally distributed variables,
each with a distinct sample size, mean, and standard deviation, and perform
a T-test. For that single simulation, evaluate if we would reject the null
hypothesis given a specific alpha-level. Now repeat this simulation many
times. Power can then be estimated as the proportion of simulations for
which we rejected the null hypothesis.