use _cox_;
read all into coxm;
n=nrow(coxm);
col=ncol(coxm);
p=col-3;
group=coxm[,1];
t=coxm[,2];
cens=coxm[,3];
z=t(coxm[ ,4:col]);
free coxm;
gvalue=unique(group)`;
gb=nrow(gvalue);
gm=j(gb,1,0);
gd=j(gb,1,0);
gindex=j(n,1,0);
do i=1 to gb;
do j=1 to n;
if group[j]=gvalue[i] then
do;
gindex[j]=i;
gm[i]=gm[i]+1;
if cens[j]=1 then gd[i]=gd[i]+1;
end;
end;
end;
print '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';
print 'Data Profile';
print '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';
reset nocenter;
if %index(a,.)=0 then %let dsname=work.a;
else %let dsname=a;
print " Data set: %upcase(&dsname)";
print " Grouping Variable: group";
print " Dependent Variable: t";
print " Censoring Variable: cens";
print " Censoring Value: 0";
print " Ties Handling: BRESLOW";
reset center;
label='';
mattrib n colname='Total' label=label
nevent colname='Event' label=label
ncens colname='Censored' label=label
percentc colname='%Censored' label=label format=6.2;
nevent=sum(cens);
ncens=n-nevent;
percentc=100*ncens/n;
print ,;
print ' Summary of the Number of ';
print ' Event and Censored Values';
print n nevent ncens percentc;
print ,;
call symput('mac_gb',trim(left(char(gb,12,0))));
reset nocenter;
print " Total number of groups: &mac_gb";
reset center;
if %upcase(greport)=Y then %str(
print /;
print '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';
print 'Summary of Group Size and the Number of Events Per Group';
print '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~';
gseq=(1:gb)`;
mattrib gseq colname='Sequence#' label=label
gvalue colname='Group' label=label
gm colname='Size' label=label
gd colname='Events' label=label;
Print gseq gvalue gm gd;
);
quit;
在日志中出现了(execution) Matrix has not been set to a value.
不知道哪块出问题了?还请大家帮忙看一下,不胜感激




雷达卡



京公网安备 11010802022788号







