Announcement

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

  • problem with didregress using a continuous treatment

    Dear statusers,

    I'm currently estimating the effect of a large public program that opened an outstanding lower high school number of classes some countries in Africa. My outcome variable (Y = mdschoolattendance, binary 0-1) is lower secondary school attendance and my treatment variable (T = newclasses, ranges from 0-750) is equal to the number of schools opened in the village of my observations during the 8 years of the program, therefore, the treatment is continuous. The treatment, as I specified, is defined at village level (id_geo, 1-2202) but also depending on the cohort (treatment_cohort, 0-1) in the sense that some were too old to be affected by the policy and others enough young.

    With this setup I've tried to use didregress, with cross-sectional data and clustering by village, however I get the same message: "The treatment variable newclasses was omitted because of collinearity".

    Code:
    didregress (mdschoolattaind) (newclasses, continuous), group(id_geo treatment_cohort) vce(cluster id_geo)
    Someone knows why this happens? I'm sure it is something obvious but I can't see it....

    Thanks in advance!

    Daniel.
    Last edited by Daniel Perez Parra; 25 Sep 2023, 02:55.

  • #2
    Show us the results of

    Code:
    xtset id_geo
    xtsum newclasses
    xtset treatment_cohort
    xtsum newclasses

    Comment


    • #3
      Originally posted by Andrew Musau View Post
      Show us the results of

      Code:
      xtset id_geo
      xtsum newclasses
      xtset treatment_cohort
      xtsum newclasses
      Thanks for your reply Andrew, here you have it:

      Code:
       xtset id_geo
      
      Panel variable: id_geo (unbalanced)
      
      . xtset id_geo
      
      Panel variable: id_geo (unbalanced)
      
      . xtsum newclasses
      
      Variable         |      Mean   Std. dev.       Min        Max |    Observations
      -----------------+--------------------------------------------+----------------
      newcla~m overall |  92.93385   137.9326          0        707 |     N =   52619
               between |             146.3207          0        707 |     n =    2204
               within  |                    0   92.93385   92.93385 | T-bar = 23.8743
      
      . xtset treatment_cohort
      
      Panel variable: treatment_cohort (unbalanced)
      
      . xtsum newclasses
      
      Variable         |      Mean   Std. dev.       Min        Max |    Observations
      -----------------+--------------------------------------------+----------------
      newcla~m overall |  92.93385   137.9326          0        707 |     N =   52619
               between |             4.624628   90.56356   97.10378 |     n =       2
               within  |             137.8967   -4.16993   707.3703 | T-bar = 26309.5

      Comment


      • #4
        So there you have it:


        Code:
        . xtsum newclasses
        
        Variable         |      Mean   Std. dev.       Min        Max |    Observations
        -----------------+--------------------------------------------+----------------
        newcla~m overall |  92.93385   137.9326          0        707 |     N =   52619
                 between |             146.3207          0        707 |     n =    2204
                 within  |                    0   92.93385   92.93385 | T-bar = 23.8743
        Your treatment variable does not vary within id_geo. So it is collinear with this variable. In other words, you cannot identify the effect of "newclasses" in the presence of id_geo fixed effects.

        Comment


        • #5
          Andrew Musau thank you so much. As I said, it was something silly, have a good day!

          Daniel.

          Comment

          Working...
          X