I have a dataset containing 952 obs. Each observations contains two options people during a survey were presented, such as G1 & G2 or G2 & G3 etc. The respondents had to choose between the two. The variable comb_G contains the combination. G1_win is a dummy for all G1 wins (1) and losses (0). Down below you can see the wins and losses of G1 per combination. Now I woudl like to construct a variable (or two) which counts the total wins and losses. That is, a variable saying 5 wins and one saying 3 losses.
I am struggeling to find a way to do it ...
Any help would be greatly appreciated!!
bysort comb_G: tab G1_win
-------------------------------------------------------------------------------------
-> comb_G = G1G2
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 6 23.08 23.08
1 | 20 76.92 100.00
------------+-----------------------------------
Total | 26 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G3
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 13 46.43 46.43
1 | 15 53.57 100.00
------------+-----------------------------------
Total | 28 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G4
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 23 74.19 74.19
1 | 8 25.81 100.00
------------+-----------------------------------
Total | 31 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G5
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 9 33.33 33.33
1 | 18 66.67 100.00
------------+-----------------------------------
Total | 27 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G6
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 10 37.04 37.04
1 | 17 62.96 100.00
------------+-----------------------------------
Total | 27 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G7
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 15 55.56 55.56
1 | 12 44.44 100.00
------------+-----------------------------------
Total | 27 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G8
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 19 67.86 67.86
1 | 9 32.14 100.00
------------+-----------------------------------
Total | 28 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G9
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 4 20.00 20.00
1 | 16 80.00 100.00
------------+-----------------------------------
Total | 20 100.00
I am struggeling to find a way to do it ...
Any help would be greatly appreciated!!
bysort comb_G: tab G1_win
-------------------------------------------------------------------------------------
-> comb_G = G1G2
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 6 23.08 23.08
1 | 20 76.92 100.00
------------+-----------------------------------
Total | 26 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G3
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 13 46.43 46.43
1 | 15 53.57 100.00
------------+-----------------------------------
Total | 28 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G4
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 23 74.19 74.19
1 | 8 25.81 100.00
------------+-----------------------------------
Total | 31 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G5
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 9 33.33 33.33
1 | 18 66.67 100.00
------------+-----------------------------------
Total | 27 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G6
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 10 37.04 37.04
1 | 17 62.96 100.00
------------+-----------------------------------
Total | 27 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G7
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 15 55.56 55.56
1 | 12 44.44 100.00
------------+-----------------------------------
Total | 27 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G8
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 19 67.86 67.86
1 | 9 32.14 100.00
------------+-----------------------------------
Total | 28 100.00
-------------------------------------------------------------------------------------
-> comb_G = G1G9
G1_win | Freq. Percent Cum.
------------+-----------------------------------
0 | 4 20.00 20.00
1 | 16 80.00 100.00
------------+-----------------------------------
Total | 20 100.00

Comment