Stata Count
The count command returns the number of cases matching a condition.
Contents
Usage
Used alone, the count command returns the number of rows in memory.
count
It is more useful with a condition.
count if foo==1
Stored Results
count stores the number of cases matching the condition in r(N).