I want to sum the column 'stat1' by the column 'Group' if it has a certain value, such as Group == 'AAA'
In non stata-syntax, I m looking for some command on the following lines:
Do sum of all corresponding values in column stat1 when value of Group == "AAA"
I would appreciate if some Stata user can help
Group | sub-group | code | Name | stat1 | stat2 | stat3 |
AAA | AA | wsed | A | 2 | 5 | 20 |
gfb | B | 54 | 43 | 22 | ||
BB | wewe | C | 33 | 43 | 35 | |
qsq | D | 4 | 20 | 43 | ||
BBB | CC | nhn | K | 54 | 43 | 22 |
asa | L | 4 | 8 | 8 | ||
DD | dsd | A | 67 | 8 | 2 | |
ss | B | 56 | 7 | 45 |
In non stata-syntax, I m looking for some command on the following lines:
Do sum of all corresponding values in column stat1 when value of Group == "AAA"
I would appreciate if some Stata user can help
Comment