Announcement

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

  • issues with clustering in ivreghdfe - insufficient observations

    I needed some advice on clustering while using ivreghdfe.

    My code is -
    HTML Code:
    ivreghdfe yvar (ever_win = true_treat), absorb(strata gender#batch city#batch yrs_school#batch age#batch mult_apply_hh#batch) vce(cluster unique_id)
    I have 78,670 observations with about 42000 distinct unique_ids. The FEs in absorb() amount to about 3000 dummies.

    The error I get is
    HTML Code:
     insufficient observations
    .

    When I remove the vce(cluster) option, the code runs properly. Could you help out with what I must be doing wrong here?

  • #2
    Try instead of
    vce(cluster unique_id) cluster(unique_id)

    Comment


    • #3
      I get the same output -
      HTML Code:
      insufficient observations

      Comment


      • #4
        You have 78,670 observations and "about 42,000" clusters (distinct unique_id's). So you will about 5,300 or more clusters with a single observation. I suspect that is the source of the problem.

        One way of testing this is
        Code:
        by unique_id: drop if _N<2
        and then see if what remains can be fit using your command. If not, try "a larger value of 2" as it were.

        Comment


        • #5
          Thanks William Lisowski . So, is there no way to do IV estimation with large number of FE but few clusters only?

          Comment

          Working...
          X