Announcement

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

  • #16
    Thanks as ever to Kit Baum, revised files for countmatch are now downloadable from SSC. Thanks again to Mabel Costa and Hemanshu Kumar for flagging the bug, as it turned out to be.

    Comment


    • #17
      Just wanted to add one more solution, in case a future reader finds it useful. This has the advantage of using only inbuilt commands, but takes a different route from the "Do-it-yourself" approach outlined in the help for the latest (v. 3.0.0 dated 07 June 2025) version of countmatch.

      Using Nick's shortened data extract in #15 (not included here for brevity), consider

      Code:
      tempfile orig set2
      save `orig'
      
      contract gvkey fyear ANALYS2, freq(wanted)
      rename ANALYS2 ana
      save `set2'
      
      use `orig'
      rename ANALYS1 ana
      
      merge m:1 gvkey fyear ana using `set2', keep(master match) keepusing(wanted) nogen
      replace wanted = 0 if missing(wanted)
      rename ana ANALYS1
      You can check that this gives the same result as countmatch by doing:
      Code:
      . countmatch ANALYS1 ANALYS2, by(gvkey fyear) gen(freq_cm)
      . assert wanted == freq_cm
      Last edited by Hemanshu Kumar; 08 Jun 2025, 02:39.

      Comment


      • #18
        Thank you so much Hemanshu Kumar & Nick for taking time to resolve the issue.

        Regards
        Mabel

        Comment

        Working...
        X