Calculating statistical power for a Cox proportional hazards regression with a continuous predictor variable I have 322 samples with survival data (71 had events) and wish to calculate the power to detect an association with a linear predictor (no covariates) at $\alpha$=0.05 and hazard ratio=1.561. Been struggling to find any help I can understand as a non-mathematician.
The results of the model are:

*

*coef=-0.07427

*exp(coef)=0.92843

*se(coef)=0.11206

*Z=-0.663

*P=0.508

This information has been requested by a co-author as a reply to a reviewer.
 A: A power calculation requires estimates both of the magnitude of the value you hypothesize and the error in that value. Such calculations are important in study design, for example determining how many individuals need to be in the study sample for a treatment, based on the effect magnitude you expect.
Once you have the data and have performed the test, a "post-hoc power (PHP) test" is pretty meaningless. In that case, you are basing calculations on an observed statistic and its standard error. All a post-hoc power analysis tells is how lucky you would have been if you had happened to get a "significant" result based on random sampling from a population having those values.
As Russ Lenth explains in Technical Report 378 from the Department of Statistics and Actuarial Science at The University of Iowa, "Post Hoc Power: Tables and Commentary":

PHP is simply a function of the P value of the test, and thus adds no new information.

He nevertheless provides tables that translate p-values to PHP. Here are some examples for a z-test like that used for individual coefficients in a Cox model (infinite degrees of freedom in a two-tailed t-test), based on a significance criterion of p < 0.05:




Observed p-value
0.01
0.05
0.1
0.25
0.5
0.75




PHP
0.7310
0.5000
0.3765
0.2100
0.1035
0.0617




So if the p-value was 0.5, then the PHP is 0.1035. That doesn't seem to represent the situation for your original value of 1.56 for a hazard ratio (a Cox regression coefficient of 0.445), but if you have the corresponding p-value then you can interpolate from this table or follow the calculations explained in that document.
Unfortunately, reviewers sometimes nevertheless ask for PHP values. Don't forget that editors, not reviewers, are responsible for decisions about publishing. The editors need to maintain the journal's reputation, and reputable journals are likely to have statistical consultants to help resolve disagreements between authors and reviewers. So one way to deal with this is to answer the reviewer's request politely with the PHP in the response to the reviewer's critique, but to explain to the editor why you are not going to include PHP values in the publication itself. You might use the above document as your justification.
A: @EdM's answer should be selected for this particular scenario.
In general, the way to perform a power calculation for a Cox proportional hazards model is to simulate data according to an exponential survival model parametrized by the median survival or the event-rate parameter. The simulation may continue to account for several other design dependent considerations such as:

*

*Rate of accrual to study

*Rate of censoring/drop out

*The trigger for the primary analysis (accrual of events, number of years from start, etc.)

All of which are endemic considerations for truly prospective study designs. Once a simulation strategy is established and the parameters are supplied, the simulated data are fit using a Cox model and the corresponding inference at the pre-specified significance level is used to calculate the fraction of "significant" results for a given sample size. There are elegant mathematical approximations to identify the sample size which are best left to professional software. For analytic formulations like OLS, the power and sample size calculation are often equivalent formulations. However, for Cox model and other simulation-based results, there is no straightforward approach other than grid-search.
