New Contributor
Posts: 2

# C statistics from fitting cox model using PROC PHREG

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.

CovariatesChDhUspairsTotobspcpdc_hatwlow_ci_wupper_ci_w
None1875267415348218906156169420.0650.0010.9920.0070.9771.000
Sex16284756262140018906156169420.0570.0090.8610.0070.8180.899
Age, Sex12821742608441418906156169420.0450.0210.6780.0070.6220.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?

New Contributor
Posts: 2