Announcement

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

  • Can numlist in egen anymatch be a local macro?

    Can numlist in egen anymatch be a local macro? For example, I cannot get to work the following:
    Code:
    levelsof id1, local(ids)
        egen matched = anymatch(id2), values(integer `ids')
    or
    Code:
    levelsof id1
        egen matched = anymatch(Subject), values(integer r(levels))
    In both cases I'm getting the followng error:
    Code:
    values() invalid -- invalid numlist
    r(121);

  • #2
    Remove "integer" from the values() option

    Code:
    sysuse auto, clear
    
    levelsof rep78, local(levs)
    egen matched = anymatch(headroom), values(`levs')

    Comment


    • #3
      Thank you, Andrea. Indeed.

      Comment

      Working...
      X