Announcement

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

  • Help with -distinct-

    I recently installed the -distinct- module and was wondering if there was a way to integrate it into a table to count distinct observations across the values of a second variable (i.e. something to the effect of 'table var1, statistic(distinct var2)'? I know it allows for by, but the variable I'd like to check has over 900 values, so that isn't practical.

  • #2
    Can you use the auto dataset to give a small example of what you want?

    Comment


    • #3
      Code:
      egen tag = tag(var1 var2)
      
      egen wanted = total(tag), by(var1)
      
      tabdisp var1, c(wanted)
      See the 2008 paper behind distinct for more.

      Comment

      Working...
      X