Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

 From ymarchenko@stata.com (Yulia Marchenko, StataCorp LP) To statalist@hsphsun2.harvard.edu Subject Re: st: AW: Artmenu fails to load in Stata 11 Date Tue, 18 May 2010 16:59:16 -0500

```Jonathan Kaplan <kaplan.joe@gmail.com> asks how to reproduce a power-curve
graph depicted on the Stata website:

> I am trying to reproduce the graph displayed in:
>
> http://www.stata.com/stata10/poweranalysis.html
>
> I'm able to reproduce the basic data using
>
> . stpower logrank 0.7, n(100 250 500) hratio(0.1(0.01)0.9) saving(mypower)
>
> However I cannot figure the correct syntax to produce the graph.

Martin Weiss <martin.weiss1@gmx.de> showed a manual way of obtaining a graph
after -stpower-
(http://www.stata.com/statalist/archive/2010-05/msg01016.html).  Jonathan can
also use the unofficial command -stpowplot- to obtain power curves for the
log-rank test more easily.  For example,

. stpowplot logrank 0.7, yaxis(power) xaxis(hr) over(n)  ///
n(100 250 500) hratio(0.1(0.01)0.9)

will produce a graph similar to that displayed on the webpage.  Following
Martin's suggestions, Jonathan can customize the graph to obtain a closer
match:

/*** begin example ****/
local title Power curves for log-rank test
local subtitle (for survival curves of experimental vs. standard treatment)
local note1 Assumptions: alpha = 0.05 (two sided); equal number of subjects
local note1 `note1' to be assigned to each group;
local note2  70% of patients in the control group survive to the end of the study
local xtitle Hypothesized effect size (hazard ratio of experimentals vs. controls)
stpowplot logrank 0.7, yaxis(power) xaxis(hr) over(n)			///
n(100 250 500) hratio(0.1(0.01)0.9)		///
title(`title') subtitle(`subtitle')		///
note("`note1'" "`note2'") 			///
xtitle(`xtitle') yline(0.8, lstyle(refline))	///
legend(off) text(.65 .4 "N = 100") 		///
text(.65 .6 "N = 250") text(.65 .75 "N = 500")
/*** end example ****/

Type

. findit stpowplot

to locate and install this command.

-- Yulia
ymarchenko@stata.com
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```