Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73337

Calculate total/collapse part of the values of one variable based on values of another category variable

$
0
0
Dear All,

In my dataset I have a categorical variable with different sub-categories:
Code:
A1 A2 A3 A4 B1 B2 C1 C2 C3
I have several other variables (var1 var2 var3...) with numeric values corresponding to each of the category. I'm trying to calculate the total of the values for each sub-category and collapse the categorical variable into general categories like:
Code:
A B C
where the values corresponding to A is the sum of A1, A2, A3 A4, the values corresponding to B is the sum of B1, B2, ...

Haven't figure out a way to do it yet...any suggestions?

Any help is appreciated!

Many thanks,
Craig





Viewing all articles
Browse latest Browse all 73337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>