Stata's power performs various power and sample-size analysis.
You can compute power, sample size, and effect size. Enter any two and get the third. You can specify single values or, to compare multiple scenarios, ranges of values of study parameters. You can obtain results either in tabular form or as a graph.
And, you can easily add your own new methods to power.
Say we are planning an experiment to determine whether students who prepare for the SAT exam obtain higher math scores by (1) taking classes rather than (2) studying independently. The national average math score is 520 with a standard deviation of 135. We want to see the power obtained for sample sizes of 100 through 500 when scores increase by 20, 40, 60, and 80 points or, equivalently, when average scores increase to 540, 560, 580, and 600.
. power twomeans 520 (540 560 580 600), n(100 200 300 400 500) sd(135) graph
We assumed above that those studying independently would obtain the national average of 520 and that the standard deviations would be 135 for both groups. We could relax either assumption using the power command.
We might be more interested in the sample size necessary to detect the increased scores at power levels of 0.8 and 0.9. In that case, we type
. power twomeans 520 (540 560 580 600), power(0.8 0.9) sd(135) graph
We can even estimate the detectable increased scores over the range of sample sizes and powers:
. power twomeans 520, power(0.8 0.9) n(100 200 300 400 500) sd(135) graph
If we prefer to see the detectable limits as effect sizes (difference between the experimental group mean and the control group mean) rather than experimental-group test scores, we add option y(delta) to the command:
. power twomeans 520, power(0.8 0.9) n(100 200 300 400 500) sd(135) graph(y(delta))
In this graph, the effect size is calculated as (experimental group mean - 520).
And see the worked examples:
Also see precision and sample-size analysis for confidence intervals.
© Copyright 1996–2024 StataCorp LLC. All rights reserved. Terms of use | Privacy policy | Contact us
We use cookies to ensure that we give you the best experience on our website—to enhance site navigation, to analyze usage, and to assist in our marketing efforts. By continuing to use our site, you consent to the storing of cookies on your device and agree to delivery of content, including web fonts and JavaScript, from third party web services. Cookie Settings
Last updated: 16 November 2022 StataCorp LLC (StataCorp) strives to provide our users with exceptional products and services. To do so, we must collect personal information from you. This information is necessary to conduct business with our existing and potential customers. We collect and use this information only where we may legally do so. This policy explains what personal information we collect, how we use it, and what rights you have to that information. Privacy policy
Required cookies Advertising cookiesThese cookies are essential for our website to function and do not store any personally identifiable information. These cookies cannot be disabled.
This website uses cookies to provide you with a better user experience. A cookie is a small piece of data our website stores on a site visitor's hard drive and accesses each time you visit so we can improve your access to our site, better understand how you use our site, and serve you content that may be of interest to you. For instance, we store a cookie when you log in to our shopping cart so that we can maintain your shopping cart should you not complete checkout. These cookies do not directly store your personal information, but they do support the ability to uniquely identify your internet browser and device. Please note: Clearing your browser cookies at any time will undo preferences saved here. The option selected here will apply only to the device you are currently using.