Announcement

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

  • Beginners help needed - How to run Nearest Neighbor Matching (nnmatch) without outcome variable value?

    Hello,

    At first, I am very beginner of using Stata.

    I am currently working on my thesis where I will use the Diff-in-Diff method to analyze whether specific publications (treatment) affect stock prices of firms which are named in these publications.

    At first, I need to find matches. I thought of Nearest neighbor matching (nnmatch). I prepared my dataset as follow:

    - Treatment: Treated (t=1) n=16 , Untreated (t=0) n > 45000
    - ISIN = Identifier
    - Matching variables: Industry, Total assets, FTE (Full-Time Employees), RoA (Return on assets)

    My procedure:
    1) I generated numeric values for the 4 matching variables: e.g., encode Industry, generate (Industry_n)


    2) I used "teffects nnmatch (Industry_n Total_assets_n FTE_n RoA_n) (Treatment), biasadj(Total_assets_n FTE_n RoA_n) vce(robust)"


    Unfortunately, this line of code always crashes my Stata as it breaks down.


    In general, I have to main questions:
    1) In literature, it is always ref. to the average treatment effects. I do not have the values of my outcome variables yet. I thought I could find matches solely based on matching variables. I have a sample of 45k possible control matching firms. I cannot calculate all of them. So, do I need a outcome variable to succesfully find matches?
    2) If not, how do I need to adjust my code in order to get matches regardless of 1-to-1 or 1-to-many?

    I really appreciate your support as I am very new to Stata and perhaps, I miss some basic understand.

    So, Thank you very, very much!!!
    Chris
    Last edited by Chris Hulstenberg; 18 Sep 2022, 05:27.

  • #2
    If you want just to identify matching observations, you could install and use one of the many community-contributed Stata packages for matching. Here are two that might work for you:
    Code:
    ssc describe ultimatch
    ssc describe kmatch
    If you're not familiar with using community-contributed packages in Stata, try -help ssc install- and click on "View complete PDF manual entry."

    Comment


    • #3
      That's great! Thank you, Mike!

      I used the following code:
      ultimatch industry_nb assets_nb fte_nb roa_nb, treated(treatment) exact(industry_nb) report (industry_nb assets_nb fte_nb roa_nb)
      Click image for larger version

Name:	Screenshot 2022-09-18 174627.png
Views:	1
Size:	73.0 KB
ID:	1682457

      But I am struggling to find an output which states: Treatment observation 1 ----> (matched) Contro, observation 1

      Could you also help here? I think it should only be an attend or short line of code.

      Thank you very much!

      Comment


      • #4
        Or does anyone else can help me here?

        I only need to display the matching pairs but I fail to find the right line or part of code.

        I am very thankful for a short notice/support!!

        Thank you, Chris

        Comment


        • #5
          I haven't used -ultimatch- myself, but -help ultimatch- indicates that the variable _match that it creates contains the same value for observations (treatment or control) that are part of the same matched set. After running -ultimatch-, you might try sorting your data set to produce a convenient ordering, and then using -browse- or -list- to see if this what you want, e.g., something like this:
          Code:
          ultimatch .....
          sort _match
          browse _match Treatment

          Comment

          Working...
          X