Estimating the sample size for a t-test using an internal pilot.

If the sample size for a t-test is calculated on the basis of a prior estimate of the variance then the power of the test at the treatment difference of interest is not robust to misspecification of the variance. We propose a t-test for a two-treatment comparison based on Stein's two-stage test which involves the use of an internal pilot to estimate variance and thus the final sample size required. We evaluate our procedure's performance and show that it controls the type I and II error rates more closely than existing methods for the same problem. We also propose a rule for choosing the size of the internal pilot, and show that this is reasonable in terms of the efficiency of the procedure.