Home  >>  Archives  >>  Volume 13 Number 1  >>  st0282

The Stata Journal
Volume 13 Number 1: pp. 21-38



Subscribe to the Stata Journal
cover

Versatile sample-size calculation using simulation

Richard Hooper
Centre for Primary Care and Public Health
Queen Mary, University of London
London, UK
[email protected]
Abstract.  I present a new Stata command, simsam, that uses simulation to determine the sample size required to achieve a given statistical power for any hypothesis test under any probability model that can be programmed in Stata. simsam returns the smallest sample size (or smallest multiple of 5, 10, or some other user-specified increment) so that the estimated power exceeds the target. The user controls the precision of the power estimate, and power is reported with a confidence interval. The sample size returned is reliable to the extent that if simsam is repeated, it will, nearly every time, give a sample size no more than one increment away.
Terms of use     View this article (PDF)

View all articles by this author: Richard Hooper

View all articles with these keywords: simsam, sample size, power, simulation

Download citation: BibTeX  RIS

Download citation and abstract: BibTeX  RIS