Stata Count

-count- counts the cases matching a condition.


Usage

Used alone, -count- returns the number of cases.

count

Used with a condition, it returns the number of cases matching it.

count if foo==1


Stored Results

-count- stores the number of cases matching the condition in r(N).


See also

Stata manual for -count-


CategoryRicottone

Stata/Count (last edited 2025-10-24 16:57:41 by DominicRicottone)