Pyrite | Level 9

## how to use proc power to calculate power given alpha, hazard ratio and number of events

In survival analysis, given alpha, hazard ratio and number of events, assuming no Interim Analysis, how to calculate the power?

8 REPLIES 8
SAS Super FREQ

## Re: how to use proc power to calculate power given alpha, hazard ratio and number of events

I believe you can use the COXREG statement in PROC POWER to get the power.

``````proc power;
coxreg
alpha = 0.1
hazardratio = 1.4
stddev = 1.0
ntotal = 80 to 120 by 10
eventprob = 0.8
power = .
;
run;``````
Pyrite | Level 9

## Re: how to use proc power to calculate power given alpha, hazard ratio and number of events

Thank you very much Rick. I will look into it.

I just did it in R, using the following code

```> z<-0.5*sqrt(n)*log(1/hr)-qnorm(1-alpha/2)
> power<-pnorm(z)```

SAS Super FREQ

## Re: how to use proc power to calculate power given alpha, hazard ratio and number of events

If you want to use an explicit formula, you can run the DATA step or PROC IML to get the same results as R:

``````data Power;
n = 20;
hr=0.3;
alpha=0.05;

z = 0.5*sqrt(n)*log(1/hr)-quantile("Normal", 1-alpha/2);
power = cdf("Normal", z);
run;

proc print; run;``````
Pyrite | Level 9

## Re: how to use proc power to calculate power given alpha, hazard ratio and number of events

Thank you very much Rick for providing code for this option.

I have a question on stddev in proc power with coxreg: how do I decide what number for stddev to use?

``stddev = 1.0``

SAS Super FREQ

## Re: how to use proc power to calculate power given alpha, hazard ratio and number of events

The parameters in the equation are usually based on pilot studies, previous research, or your best guess.

Quartz | Level 8

## Re: how to use proc power to calculate power given alpha, hazard ratio and number of events

Hi all,

A follow-up question to the [proc power]: can it integrate correlation coefficient in multilevel data?

Thanks!

Hao

Quartz | Level 8

## Re: how to use proc power to calculate power given alpha, hazard ratio and number of events

Hello, Rick. I am not sure about the parameter stddev. Is it the standard error of a coefficient estimate from a PROC PHREG procedure, or something different? Thanks.
SAS Employee

## Re: how to use proc power to calculate power given alpha, hazard ratio and number of events

The STDDEV= option in the COXREG statement is the assumed standard deviation of the predictor being tested---that is, your best guess of the true standard deviation of this predictor's sampling distribution under the same conditions as expected in the study you're planning. This isn't the same as the standard error of a coefficient estimate, just a simple property of the predictor variable itself as it would be sampled (or perhaps taking on values that you control yourself) in your planned study.

I'd also like to point out that the original question in this thread didn't specify what kind of data analysis is being planned, and it could just as easily pertain to the TWOSAMPLESURVIVAL statement in PROC POWER if you're planning a logrank test rather than a Cox proportional hazards regression. These are two scenarios in which PROC POWER supports the calculation of power for a survival analysis given alpha, hazard ratio, and number of events.

Discussion stats
• 8 replies
• 1384 views
• 4 likes
• 5 in conversation