2018年10月11日星期四

steps for simulation sample size

  1. Write the statistical model mathematically.
  2. Generate the sample according to the model with sample size N.
  3. Fit the model, perform the test, and record the rejection or acceptance of hull hypothesis.
  4. Repeat step 2 and 3 n (generally I used 5000) times.
  5. Calculate the power by (# of rejections)/n.
6 If power is too higher, decrease sample size N, repeat 2 - 5. If power is too lower, increase sample size N, repeat 2 - 5.