Announcement

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

  • Matching firms in the same industry and year based on a specific variable

    Hello,

    I am trying to match firm-year observation with the same firm in the same industry and year with the closest return on assets in the current year, ROAit (net income divided bytotal assets). can you please help me with the Stata command how to do that? (Kothari model)

    Regards,
    Sally


  • #2
    Sally:
    provided that I'm unclear with what you're after, I would advise you to take a look at the -group- function available from -egen-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I think O.P. is trying to form matched pairs in the data. The code for creating matched pairs is somewhat complicated and has to account for idiosyncratic aspects of the data, so without example data being shown, it is difficult to give specific advice on how to proceed. Please post back showing example data. Be sure to pick your example so that there will be some matches included in what you show. Be sure to use the -dataex- command to show the example data so that anyone who wants to help you can actually work with the data and write code that can work in it. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

      Also, please clarify some aspects of how you want the match done. When you say
      I am trying to match firm-year observation with the same firm in the same industry and year with the closest return on assets in the current year [emphasis added]
      it sounds like you are constrained to match every firm with itself. Now, perhaps the unit of analysis in your data is lower than the firm, for example divisions or branches, and you are in fact trying to match one division to another division in the same firm. And perhaps that would be obvious if example data were available. But it seems unusual, so I suspect that the description is not quite correct.

      One other thing needs to be clarified. Do you want matching with replacement or without replacement? Matching with replacement means that the same "control" firm can be matched to more than one "case" firm. Matching without replacement means that once a "control" firm is matched to one "case" firm, it cannot be re-used as a match to another firm even if it would otherwise be the best possible match for that other firm. Matching without replacement has some disadvantages: it results in less close matching on continuous variables like ROAit and more "case" firms failing to find any match at all. It is also slightly more complicated to code, and in a very large data set it takes longer to run. I am not aware of any compensating advantages to matching without replacement, yet my experience here is that many people prefer it anyway, perhaps for some obscure aesthetic reason.

      Comment

      Working...
      X