Hi, everybody, I have this dataset with 12 variables I am trying to calculate the CCI index for the variables. I am using this code but I am getting twice the variables without changing yes or no to its proper numeric value per condition. The code is the following. Also attached is the original csv file. data risk;
set datasets.riskdata;
if diagnosis= 'TYPE1_DM' then diagnosis='y';
if diagnosis='TYPE2_DM' THEN DIAGNOSIS='n';
if diagnosis= 'PXECTMY' then diagnosis='n';
if los<0 then los=.;
array a{10} diagnosis dialysis lipiddis cbv_ds pvd neuropthy respprob cancrpre cbypass mi;
do i=1 to 10;
if A{i}=' ' then a{i}=.;
if a{i}= 999 then a{i}=.;
if a{i}= u then a{i}=.;
if a{i}= 9 then a{i}=.;
drop i;
end;
array b{10} diagnosis dialysis lipiddis cbv_ds pvd neuropthy respprob cancrpre cbypass mi;
array c{10} (2,3,2,1,1,1,1,3,1,2 );
do i=1 to 10;
if (B{i})='y' then CCI = CCI + B(c{i});
if (B{i})= 'n' then B(c{i})=0;
else if (B{i})='.' then CCI+B(c{i})=0;
drop i;
end;
run; and this is the error message NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 81:18 82:19 83:17 84:17 91:21 NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 82:4 84:4 90:32 92:29 NOTE: Variable u is uninitialized. NOTE: Invalid numeric data, 'y' , at line 82 column 4. NOTE: Invalid numeric data, 'y' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 82 column 4. NOTE: Invalid numeric data, 'Y' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 82 column 4. NOTE: Invalid numeric data, 'Y' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 90 column 32. Case_ID=641 DIAGNOSIS=y LOS=13 Dialysis=Y LipidDis=N CbV_DS=N PVD=N Neuropthy=Y RespProb=N CancrPre=N CBYPASS=N MI=N i=11 u= c1=2 c2=3 c3=2 c4=1 c5=1 c6=1 c7=1 c8=3 c9=1 c10=2 CCI=. _ERROR_=1 _N_=1 NOTE: Invalid numeric data, 'y' , at line 82 column 4. NOTE: Invalid numeric data, 'y' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 82 column 4. NOTE: Invalid numeric data, 'Y' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 82 column 4. NOTE: Invalid numeric data, 'Y' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 82 column 4. NOTE: Invalid numeric data, 'Y' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 82 column 4. NOTE: Invalid numeric data, 'Y' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 90 column 32. Case_ID=1173 DIAGNOSIS=y LOS=7 Dialysis=Y LipidDis=Y CbV_DS=N PVD=N Neuropthy=Y RespProb=Y CancrPre=N CBYPASS=N MI=N i=11 u= c1=2 c2=3 c3=2 c4=1 c5=1 c6=1 c7=1 c8=3 c9=1 c10=2 CCI=. _ERROR_=1 _N_=2 NOTE: Invalid numeric data, 'y' , at line 82 column 4. NOTE: Invalid numeric data, 'y' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 82 column 4. NOTE: Invalid numeric data, 'Y' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 82 column 4. NOTE: Invalid numeric data, 'Y' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'N' , at line 82 column 4. NOTE: Invalid numeric data, 'N' , at line 84 column 4. NOTE: Invalid numeric data, 'Y' , at line 90 column 32. Case_ID=1234 DIAGNOSIS=y LOS=8 Dialysis=Y LipidDis=N CbV_DS=N PVD=N Neuropthy=Y RespProb=N CancrPre=N CBYPASS=N MI=N i=11 u= c1=2 c2=3 c3=2 c4=1 c5=1 c6=1 c7=1 c8=3 c9=1 c10=2 CCI=. _ERROR_=1 _N_=3
... View more