Announcement

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

  • psmatch2: selecting matches within subgroups

    Hello,

    I have 800 case information against 450 US-traded firms. Some of the firms have US origin, while the others foreign firms. The cases were filed between 2000 and 2024.

    I have population data of 10,000 firms traded in USA. I want to match samples based on variables xa, x2, x3.

    (Condition 1) I want to make sure that US treatment firms are matched with US controls.
    (Condition 2) The treatment and control firms have to be from the same industry.
    (Condition3) Also, if firm A faced a case in the year 2013 for example, I want the matched observation to be from 2013 as well.

    How can I develop psmatch2 codes for this situation?

    Note: I have matched using gamtch command before. It gave good results as long as I was not considering the Condition 3.

    Thanks a lot for your support.

    Best Regards,
    Atiqur
    Last edited by Md Atiqur Rahman; 13 Nov 2024, 10:37.

  • #2
    My friend Chatgpt gave the following codes:
    gen matchgroup = us_origin * 1000 + industry_code * 100 + case_year
    psmatch2 treatment (xa x2 x3) ///
    method(knn) neighbor(1) ///
    caliper(0.05) ///
    gen(matched) ///
    mahalanobis ///
    if matchgroup==matchgroup, noreplace

    Definitely not working! :p
    Last edited by Md Atiqur Rahman; 13 Nov 2024, 10:55.

    Comment


    • #3
      maybe use "kmatch ps" and set the "exact" option to a country id and industry id and treatment year.

      EDIT: sorry, kmatch ps does not allow exact.
      Last edited by George Ford; 14 Nov 2024, 18:36.

      Comment


      • #4
        help psmatch2

        there's a section on "matching within strata"

        Comment


        • #5
          Hello george Ford, thanks for your response. It was helpful.

          Comment

          Working...
          X