Hello all,
I have a problem and would really appreciate your input. So here it is:
Context: c-statistics from cox regression analysis
Samples: 16,942 participants below age 75 years old
Events (death): 1,116
Variables: idn, duration, age, sex, censory
Syntax Syntax used is adapted from SAS Global Forum Paper (1): Liu L, Forman S, Barton B. Fitting Cox model using PROC PHREG and beyond in SAS. SAS Glob Forum [Internet]. 2009 [cited 2015 Aug 4]; Available from: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.176.1835&rep=rep1&type=pdf
Sy
Syntax:
proc phreg data=Below75allsubjectiveobjective;
id idn;
model duration*censory(0)= age sex;
output out=obs survival=surv;
run;
data evtset; set obs; if censory=1; rename idn=idn_j surv=y_j duration=x_j;
keep idn surv duration; run;
proc sql;
create table allset as
select idn_j, y_j, x_j, idn as idn_i, surv as y_i, duration as x_i
from evtset, obs
where idn_j<>idn;
quit;
data concord;
set allset;
if (x_i<x_j and y_i>y_j) or (x_i>x_j and y_i<y_j) then concord=1;
else concord=0;
run;
data _null_;
set concord end=eof;
retain nch ndh;
if _N_=1 then do;
nch=0;
ndh=0;
end;
if concord=1 then nch+1;
if concord=0 then ndh+1;
if eof=1 then do;
call symput('ch',trim(left(nch)));
call symput('dh',trim(left(ndh)));
call symput('uspairs',trim(left(_n_)));
end;
run;
data _null_;
set Below75allsubjectiveobjective end=eof;
if eof=1 then call symput('totobs',trim(left(_n_)));
run;
%put &ch &dh &uspairs &totobs;
data calculat;
ch=input("&ch",12.0);
dh=input("&dh",12.0);
uspairs=input("&uspairs",12.0);
totobs=input("&totobs",10.0);
pc=ch/(totobs*(totobs-1));
pd=dh/(totobs*(totobs-1));
c_hat=pc/(pc+pd);
w=(2*1.96**2)/(totobs*(pc+pd));
low_ci_w=((w+2*c_hat)/(2*(1+w)))-(sqrt((w**2+4*w*c_hat*(1-
c_hat))/(2*(1+w))));
upper_ci_w=((w+2*c_hat)/(2*(1+w)))+(sqrt((w**2+4*w*c_hat*(1-
c_hat))/(2*(1+w))));
run;
This syntax runs smoothly without any errors.
Output when adding different covariates:
Covariates | Ch | Dh | Uspairs | Totobs | pc | pd | c_hat | w | low_ci_w | upper_ci_w | |
---|---|---|---|---|---|---|---|---|---|---|---|
None | 18752674 | 153482 | 18906156 | 16942 | 0.065 | 0.001 | 0.992 | 0.007 | 0.977 | 1.000 | |
Sex | 16284756 | 2621400 | 18906156 | 16942 | 0.057 | 0.009 | 0.861 | 0.007 | 0.818 | 0.899 | |
Age, Sex | 12821742 | 6084414 | 18906156 | 16942 | 0.045 | 0.021 | 0.678 | 0.007 | 0.622 | 0.732 | |
C-hat from the output is the c-statistics calculated, is that correct?
Problem: Why is C-statistics decreasing when adding more covariates? How do I interpret the c-statistics results?
Thank you in advance
Can anyone please explain the output to me? What is pc, ph etc? Or maybe link me to a decent guide?
Also, shouldn't the fourth line of syntax should be 'duration*censory(1)' because censory=1 is death, which is what we're interested in for cox regression?
were you able to figure out what the problem was? i am having the same problem
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.