BookmarkSubscribeRSS Feed
NicoO_neilly
Calcite | Level 5

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:

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?


Thank you in advance Smiley Happy

2 REPLIES 2
NicoO_neilly
Calcite | Level 5

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?

samarda
Calcite | Level 5

were you able to figure out what the problem was? i am having the same problem

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 2071 views
  • 0 likes
  • 2 in conversation