I am trying to calculate the power for Cox PH analysis using the cpower function in the Hmisc package. The following is sort of “post-hoc power”, mainly to understand how the function works.

There are 2 groups, with 2500 subjects in each group, follow-up time is 6 months or 0.5 years, I estimated the survival probabilities using the survfit.coxph function, with S0 and S1 are the survival probabilities at the median survival time (which is the same for both groups).

The I ran:

```
cpower(tref=0.5, tmin=0.5, accrual=0, nc=2444, ni=2444, mc=1-S0, r=(1-S1)/(1-S0))
```

The result I get is completely different from the results I get using bpower, the powerCT, powerCT.default and powerCT.default0 functions from the powerSurvEpi package, and “by hand calculation” following chapter 28 in Handbook of Survival Analysis (Klein et. al. 2016), which all yield similar results (give of take a few percentage points). Any idea?

r doesn’t look like a hazard ratio in your invocation of `cpower`

.

Note that power calculations never use observed data, so it would be far better to simplify the example using a good estimate of `S0`

and inserted the effect (hazard ratio) you don’t want to miss.

It still does not make sense.

```
cpower(nc=2444, ni=2444, mc=1-S0, r=0.65, tref=0.5, tmin=0.5, accrual=0)
```

returns power of 5% (in words: five percent) for S0=0.98, while all the powerSurvEpi functions, as well as direct calculation, provide power in the range of 40-50%. Even naive calculation for comparing proportion/logistic regression returns power of 38%:

```
bpower(p1=1-S0, odds.ratio=0.65, n1=2444, n2=2444)
```

Regarding the r parameter in the cpower function, the package manual specifies that r should be “% reduction in mc by intervention”, not a hazard ratio. Needless to say, when specifying the meaningful HR (0.65), the result is still awkward

Sorry I didn’t remember my own function’s arguments correctly. I still think something isn’t specified correctly. You shouldn’t see differences that large. Look at the examples that come with `cpower`

and try to reproduce them in the other system first.