Hi guys,
suppose to have the following dataset:
data have;
length Class1 $ 20 Class2 $ 20 Value $20;
input Class1 Class2 Value ;
cards;
Blood_disease Overall 5
. Specific_value 1
Lung_disease Overall 3
. Lung_Cancer 1
. COPD 1
. RSV 1
;
run;
Is there a way to get the following?
data have1;
length Class1 $ 20 Class2 $ 20 Value $20;
input Class1 Class2 Value ;
cards;
Blood_disease Overall 5
. Specific_value 5
Lung_disease Overall 3
. Lung_Cancer 1
. COPD 1
. RSV 1
;
run;
The dataset have1 comes from previous computations.
If you look at Class1 = Lung_disease the Overall value of Class2 is the sum of Lung_Cancer, COPD and RSV Values. This because (by chance) each patient hade one specific disease. For Blood_disease the previous computation counts "Specific_value" only one time although 5 patients had that disease as in "Overall". Is there a way to adjust or correct in order to get have1?
Unfortunately I cannot modify previous coding.
Note that only a simplified but realistic version of the dataset is shown. No other particular cases are present.
Thank you in advance