Hello,
This piece of code is not correctly assigning all breast cancer cases. Could someone identify the error?
*create sample dataset;
data sample ;
input curr_topog_desc $30. ;
cards ;
Rectum NOS
Overlapping lesion of breast
Head of pancreas
Blood
Breast NOS
" " *meant to be blank;
;
run;
Data sample;
Set sample;
IF index(curr_topog_desc, "breast") ne 0 then do;
breastcancer = 1;
othercancer = 0;
end;
*if blank space, the person was not linked to cancer registry;
IF curr_topog_desc = " " THEN do;
breastcancer = 0;
othercancer = 0;
end;
*meant to capture all other cancers;
ELSE do;
breastcancer = 0;
othercancer = 1;
end;
run;