I have a simple question about the distinct
command in Stata.
When using with a by
prefix, can it return a one dimension matrix of r(N)
?
For example:
sysuse auto,clear
bysort foreign: distinct rep78
Can I store a [2,1]
matrix, with each row representing the number of distinct values of rep78
?
The manual seems to suggest that it only stores the number of distinct values of the last by value.