You are not logged in. You can browse but not post. Login or Register by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the FAQ.
Take a look at -help levelsof-. -levelsof- displays a sorted list of distinct values of varnames, which you can store in a local macro for future use with the local() option.
although -codebook- does not save this result, there are other commands that do, including -inspect- (saved as "r(N_unique)") or the user-written -distinct- (save as " r(ndistinct)"); use -search- to find and download -distinct-
Comment