Announcement

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

  • Estimating averages by groups for a matched sample of companies

    Hello,

    I would like to calculate the average turnover of treated companies and compare the value to a matched sample of non-treated companies. The matched pair IDs are shown in a variable called "pairs".

    Can you please help me estimate the values below using a small subset of my dataset as an example?

    average turnover of treated companies = (132 + 27)/2
    average turnover of matched non-treated companies = (128 + 26)/2

    Thank you.
    company year treated turnover pairs
    Company A 2014 0 134 1
    Company A 2015 1 132 2
    Company A 2016 0 145 3
    Company B 2014 0 129 1
    Company B 2015 0 128 2
    Company B 2016 0 122 3
    Company C 2014 0 23 4
    Company C 2015 0 24 5
    Company C 2016 1 27 6
    Company D 2014 0 20 4
    Company D 2015 0 21 5
    Company D 2016 0 26 6


  • #2
    Nadya:
    you may want to try:
    Code:
    . bysort treated: sum turnover
    
    ---------------------------------------------------------------------------------------------------------------------------
    -> treated = 0
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
        turnover |         10        77.2    57.65183         20        145
    
    ---------------------------------------------------------------------------------------------------------------------------
    -> treated = 1
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
        turnover |          2        79.5    74.24621         27        132
    
    
    .
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Hi Carlo,

      Thank you for your response. I thought of doing it this way, but the average turnover for no-treated businesses is based on 10 observations (rather than 2 as in my example). I want the estimate to be equal to 77.0 and not 77.2.

      In other words, I only want to include matched companies.

      Comment


      • #4
        Nadya:
        sorry, but I'm not clear with what you're after.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Ok, I will try to explain it.

          I used Propensity Score Matching to match treated companies with non-treated companies based on observable business characteristics (such as industry, location, age etc). Matched pairs are given pair IDs (saved in a new variable called pairs). So, in 2014, company A is matched with company B.

          I would like to estimate the average turnover of all treated businesses and compare that to non-treated business with the same pair IDs. So, if my average for the treatment group is based on company A (2015) and Company C (2016), I need the average for the non-treated group to be based on Company B (2015) and company D (2016).




          Comment


          • #6
            perhaps,
            Code:
            bys pairs: egen matched = max(treated==1)
            bys treated: sum turnover if matched

            Comment

            Working...
            X