so like this (given the dataex below):
Group 1 | Group 2 | Group 3 | Group 4 | |
distinct cID | 2 | 1 | 2 | 1 |
There are many more cID in the data, from using codebook group 2 has 33 distinct cID values in my actual data, but I would prefer to have a convenient way to tabulate this without having to do codebook since there will be many different stratification.
Thanks
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float cID long group 1 1 1 3 1 3 1 3 1 3 1 3 1 1 1 3 1 3 1 3 2 4 2 3 2 2 2 2 2 2 2 2 2 3 2 2 2 3 2 2 2 3 2 2 2 2 2 2 2 2 2 3 2 2 2 3 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 3 2 3 2 3 2 4 2 3 2 3 2 3 2 2 2 1 2 2 2 3 2 2 2 3 2 3 2 3 2 3 2 4 2 2 2 2 2 3 2 2 2 2 2 3 2 2 2 2 2 3 2 2 2 3 2 3 2 2 2 2 2 2 2 3 2 3 2 2 2 2 2 3 2 4 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 3 2 3 2 3 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 3 2 2 2 1 2 2 2 3 2 2 2 3 2 3 end
0 Response to Tabulating distinct counts of an ID by group
Post a Comment