計算 cox 模型的一致性(C 指數)我正在嘗試在 cox 模型的 JMP 10 中計算一致性指數。 我為 SAS 找到了這篇論文:
http://support.sas.com/resources/papers/proceedings09/236-2009.pdf
但我不太明白它在做什麼。 任何幫助表示讚賞。
proc sql;
create table allset as
select idn_j, y_j, x_j, idn as idn_i, surv as y_i, combdays 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 sample 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; 回复:計算 cox 模型的一致性(C 指數)這是我對 SAS 代碼的評論
//This step does a cartesian join of the evtset and obs data tables,
// but eliminates any rows where the column idn_j=idn
// To do this in JMP would be a 2 step process. Use
// Tables==>Join
// and specify to perform a Cartesian Join, then find all rows in
// the new data table where idn_j==idn and delete them
proc sql;
create table allset as
select idn_j, y_j, x_j, idn as idn_i, surv as y_i, combdays as x_i
from evtset, obs
where idn_j<>idn;
quit;
// This step just creates a new column called "concord"
// SAS has to create a new table to do this, where JMP could
// just add it to the allset data table from the join step
data concord;
set allset;
if (x_i<X_J and="" y_i="">y_j) or (x_i>x_j and y_i<Y_J></Y_J></X_J>