Hello,
I have 3 variables here:
c1 c2 c3
40 40 .
5 20 5
I want to replace these entries as the share of the total of the three variables, however if for example in the first row above the third variable is missing, I want the share to be taken of the total of the first two variables only.
For example the two '40' entries above would become 50 and 50 (in % form), and the three entries in the row below would become 16.6, 66, 16.6.
And if for example two of the three variables were missing, the entry would automatically become 100.
How can I implement something like this on a large scale?
Thanks,
Jad
I have 3 variables here:
c1 c2 c3
40 40 .
5 20 5
I want to replace these entries as the share of the total of the three variables, however if for example in the first row above the third variable is missing, I want the share to be taken of the total of the first two variables only.
For example the two '40' entries above would become 50 and 50 (in % form), and the three entries in the row below would become 16.6, 66, 16.6.
And if for example two of the three variables were missing, the entry would automatically become 100.
How can I implement something like this on a large scale?
Thanks,
Jad
Comment