Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unique values value?

    How can I use in Stata the value obtained in "unique values" that the codebook command returns?
    Thanks

  • #2
    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.

    Comment


    • #3
      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

      Working...
      X