Hi
First my dataset is similar to:
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(cat1 type01 type02 type03 cat2 type11 type12 type13)
1 1 . . 1 1 . .
1 . 1 . 1 1 . .
1 . . 1 1 1 . .
2 . 1 . 1 . 1 .
2 . 1 . 2 . 1 .
3 . . 1 2 . 1 .
3 1 . . 3 . 1 .
3 . . 1 3 . . 1
3 . . 1 3 . 1 .
4 . 1 . 3 . 1 .
5 . 1 . 4 . . 1
6 1 . . 4 . . 1
6 1 . . 4 . 1 .
. . . . 4 . 1 .
end

I want to plot the cumulative number of categories(including cat1 & cat2 here) vs. the number of each type in cumulated categories.(sorted by x)
for example, for the first category, y=1/(4+6)=0.1 and x={1,1,1} for three different types.
and for the seventh category, y=0.7, and x={7,6,4}- the first element of x is the total number of type01 and type11 in all the categories which are considered, the second one is type02 and type12 ...

Thanks