I have a set of 5 dummy variables. Call them v1,v2,v3,v4,v5. I would like to know how many times each combination of 5 values occurs. The desired output would look like this.
v1 v2 v3 v4 v5 Frequency
1 1 1 1 1 10000
1 0 1 1 1 3000
1 0 1 0 1 3000
<snip>
This says that there are 10,000 rows where all 5 variables are 1, 3,000 rows where v2=0 and the other four variables are 1, 3,000 rows where v2=v4=0 and v1=v3=v5=1, and so on.
I can figure out how to write a little program that produces this out, but I'm hoping there's an existing command that does it already. There are simple commands do to this in SAS, SQL, and Unix, so I'm hoping there's also a simple way to do it in Stata.
Thanks!
Paul
v1 v2 v3 v4 v5 Frequency
1 1 1 1 1 10000
1 0 1 1 1 3000
1 0 1 0 1 3000
<snip>
This says that there are 10,000 rows where all 5 variables are 1, 3,000 rows where v2=0 and the other four variables are 1, 3,000 rows where v2=v4=0 and v1=v3=v5=1, and so on.
I can figure out how to write a little program that produces this out, but I'm hoping there's an existing command that does it already. There are simple commands do to this in SAS, SQL, and Unix, so I'm hoping there's also a simple way to do it in Stata.
Thanks!
Paul
Comment