Hi, ballardw
Thanks for your feedback. I think I had misunderstood the meaning of the parameter
stddev=&se
The value of the stddev should not be derived from the observed confidence interval, i.e., se = (log(hrUpper) - log(hrLower)/(2*1.96))
%let hrUpper = 1.08;
%let hrLower = 0.60;
Instead, the values of hrUpper and hrLower are the presumed boundary of the confidence interval. My code is wrong, because I presume a significance difference, but I inputted a HR confidence across 1.0, obviously. I think the stddev parameter controls the presumed width of confidence intervals. Therefore, the narrower the width (more precise), the more sample observations are required.
Above is my present understanding of the PROC POWER with coxreg statement. I corrected my code as follow,
%macro P;
%let evTotal = 184; /*Event actually occurred*/
%let hr = 0.90 0.80 0.70; /*Presumed true HRs*/
%let desPower = 0.80 0.90; /*Power goals*/
%let hrUpper = 1.00; /*Presumed upper CI boundary of HR*/
%let hrLower = 0.50; /*Presumed lower CI boundary of HR*/
%let lnHrUpper = %sysfunc(log(&hrUpper));
%let lnHrLower = %sysfunc(log(&hrLower));
%let se = %sysevalf((&lnHrupper - &lnHrLower)/2*1.96);
%put The value of lnHrUpper is &lnHrUpper;
%put The value of lnHrLower is &lnHrLower;
%put The value of se is &se;
ods pdf file = '/home/tomhsiung0/Academic/powerCalc.pdf';
proc power;
coxreg
hazardratio = &hr
stddev=&se
eventstotal = &evTotal
power = .
;
run;
proc power;
coxreg
hazardratio = &hr
stddev=&se
eventstotal = .
power = &desPower
;
run;
ods pdf close;
%mend;
%p;
With a result of,
So, we have a power of 90.8% to detect a presumed HR of 0.70, with presumed CI of 0.50-1.00 (stddev = 0.679284). And the fact is we did not get this result, so we are 90.8% sure the true HR is larger than 0.70
... View more