Announcement

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

  • reghdfe: the results for two-way cluster and one-way cluster are the same, why?

    I expect the standard errors of two-way clustering and one-way clustering are different, however, the resutls are the same, why? Then should I use one-way cluster or two-way cluster?

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte ind long(dvPrior dv) float(IV1 firmID) double IV2
     7 254  267   83  1   68
     7 254  267   83  1   68
     7 254  267   83  1   68
     7 254  267   83  1   68
     7 254  267   83  1   68
     3   0    0 85.6  2 68.8
     3   0    0 85.6  2 68.8
     3   0    0 85.6  2 68.8
     3   0    0 85.6  2 68.8
     3   0    0 85.6  2 68.8
     8 392   78 82.8  3   65
     8 392   78 82.8  3   65
     8 392   78 82.8  3   65
     8 392   78 82.8  3   65
     8 392   78 82.8  3   65
     8 121    0 81.2  4   70
     8 121    0 81.2  4   70
     8 121    0 81.2  4   70
     8 121    0 81.2  4   70
     8 121    0 81.2  4   70
     8 123 1668   84  5 72.1
     8 123 1668   84  5 72.1
     8 123 1668   84  5 72.1
     8 123 1668   84  5 72.1
     8 123 1668   84  5 72.1
     8  48    0 82.4  6 72.4
     8  48    0 82.4  6 72.4
     8  48    0 82.4  6 72.4
     8  48    0 82.4  6 72.4
     8  48    0 82.4  6 72.4
     8   7   20 81.8  7 67.7
     8   7   20 81.8  7 67.7
     8   7   20 81.8  7 67.7
     8   7   20 81.8  7 67.7
     8   7   20 81.8  7 67.7
     8  30   68 84.2  8 69.4
     8  30   68 84.2  8 69.4
     8  30   68 84.2  8 69.4
     8  30   68 84.2  8 69.4
     8  30   68 84.2  8 69.4
    10   0    0 83.8  9   70
    10   0    0 83.8  9   70
    10   0    0 83.8  9   70
    10   0    0 83.8  9   70
    10   0    0 83.8  9   70
     8  26   43   82 10 75.2
     8  26   43   82 10 75.2
     8  26   43   82 10 75.2
     8  26   43   82 10 75.2
     8  26   43   82 10 75.2
    end
    reghdfe dv dvPrior IV1 IV2, vce(cluster ind )
    reghdfe dv dvPrior IV1 IV2, vce(cluster ind firmID)
    Last edited by Fred Lee; 07 Jan 2025, 06:16.

  • #2
    It looks as if firmID is nested within industry, so if you cluster by firmID, clustering by industry is redundant.

    Comment


    • #3
      You are true, the firmID is nested within industry. Howver, the above results are different from

      Code:
      reghdfe dv dvPrior IV1 IV2, vce(cluster firmID )
      It seems that, if I cluster by firmID & industry, clustering by firmID is redundant rather than industry
      As you said, I expect inudustry is redundant rather than firmID

      Comment


      • #4
        My bad, I meant to say that if you cluster by industry, clustering by firmID is irrelevant because all firms in a given industry are already in the same industry cluster.

        Comment


        • #5
          I'm sorry, I didn't quite understand. I thought higher levels would defer to lower levels since the latter have more categories while the former have fewer.

          Comment


          • #6
            The data is invariant by firm.

            Comment


            • #7
              Originally posted by George Ford View Post
              The data is invariant by firm.
              It's true. But the data of IV below for each firm varies. However, vce(firm) and vce(firm industry) still have the same resutls.
              Code:
              * Example generated by -dataex-. For more info, type help dataex
              clear
              input byte ind long(dvPrior dv) float(IV1 firmID)
               7 254  267   83  1
               7 254  267   85  1
               7 254  267   83  1
               7 254  267   85  1
               7 254  267   83  1
               3   0    0 85.6  2
               3   0    0 85.6  2
               3   0    0 85.6  2
               3   0    0   75  2
               3   0    0 85.6  2
               8 392   78 82.8  3
               8 392   78 82.8  3
               8 392   78 82.8  3
               8 392   78 82.8  3
               8 392   78 82.8  3
               8 121    0 81.2  4
               8 121    0   72  4
               8 121    0 81.2  4
               8 121    0 81.2  4
               8 121    0 81.2  4
               8 123 1668   84  5
               8 123 1668   84  5
               8 123 1668   84  5
               8 123 1668   72  5
               8 123 1668   84  5
               8  48    0 82.4  6
               8  48    0 82.4  6
               8  48    0 82.4  6
               8  48    0 82.4  6
               8  48    0 82.4  6
               8   7   20   72  7
               8   7   20 81.8  7
               8   7   20 81.8  7
               8   7   20 81.8  7
               8   7   20 81.8  7
               8  30   68 84.2  8
               8  30   68 84.2  8
               8  30   68 84.2  8
               8  30   68 84.2  8
               8  30   68 84.2  8
              10   0    0 83.8  9
              10   0    0   72  9
              10   0    0 83.8  9
              10   0    0 83.8  9
              10   0    0 83.8  9
               8  26   43   82 10
               8  26   43   82 10
               8  26   43   72 10
               8  26   43   82 10
               8  26   43   82 10
              end
              
              reghdfe dv dvPrior IV1 , vce(cluster firmID ind)
              reghdfe dv dvPrior IV1, vce(cluster firmID )

              Last edited by Fred Lee; 07 Jan 2025, 10:16.

              Comment


              • #8
                Clustering by industry already accounts for arbitrary correlation of errors within each industry, including all firms, so adding firm clustering doesn't identify any additional correlation structure. Sometimes people cluster on id and year since they are not nested.

                When nested, the most aggregated, not least, is the one used.

                Which is what Joao said.

                Comment


                • #9
                  Originally posted by George Ford View Post
                  Clustering by industry already accounts for arbitrary correlation of errors within each industry, including all firms, so adding firm clustering doesn't identify any additional correlation structure. Sometimes people cluster on id and year since they are not nested.

                  When nested, the most aggregated, not least, is the one used.

                  Which is what Joao said.
                  I see! I understand! Thanks so much for your patient response! One more question, if using cluster by ind, the IV is significant, while using cluster by firm, the IV is insignificant. Can I use the former cluster way? How to choose approprite cluster?

                  Comment

                  Working...
                  X