Announcement

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

  • cluster2

    Dear all,

    I am running stata13, and downloaded cluster2.ado from
    http://www.kellogg.northwestern.edu/...rs/se/cluster2.

    and copy it to C:\ado\personal

    I ran the code below and got an error message

    use Data/company
    xi i.fyear

    foreach x in debtr debtmr {
    foreach y in hhi_ ccl hhi_ocl {
    cluster2 `x' `y' _Ifyear*, icluster(gvkey) tcluster(fyear)
    }
    }


    *******error message*******​

    option fcluster() required

    Could you please tell me what I did wrong?

    thanks,
    Rochelle





  • #2
    you did not include option "fcluster()" which is, apparently required (i.e., not an option); I think the error message is very clear and I can see that you did not include "fcluster()", so maybe I'm missing something?

    Comment


    • #3
      You need to replace "icluster()" with "fcluster()".

      Comment


      • #4
        Many thanks to both Rich and Jeff !!!

        Comment


        • #5
          Hi all,
          I just ran a two-way clustered regression and I noticed that one of my variable has missing standard error. I used country and year as the cluster base. I had 40,005 observations (firm-years) and there were 22 countries and 20 observation years.

          The excerpt of my results are as follow:

          Number of obs = 40005
          F( 14, 382) = 758.52
          Prob > F = 0.0000
          Number of clusters (ISOCOUNTRYCODE) = 22 R-squared = 0.4181
          Number of clusters (FYEAR1) = 20 Root MSE = 0.0426


          Coef. Std. Err. t P>|t| [95% Conf. Interval]

          PrevYear Performance | .0065925 .0091355 0.72 0.471 -.0113696 .0245546
          GDP Growth | .0033994 . . .................................................. .....

          Besides GDP Growth, I also had another country-level variable of which standard error is not missing.
          I used cluster2 command in my analysis.
          Is there anyone who can help me how to make the standard error of GDPGrowth appear?
          Any help much appreciated.
          Regards,
          Ronny

          Comment


          • #6
            Two-way clustering can lead to non-positive definite matrices, due to either small samples not far enough to the land of asymptotia (and you are exactly half way there, if you believe in what Mostly Harmless Econometrics has to say about the ultimate answer to life, the universe, and the number of clusters sufficient for adequacy of cluster-corrected standard errors), and/or violations of some unstated and unverified assumptions (namely absence of any cross-correlations between units i,t and j,s if i != j and t != s; the residual for Norway's growth in year 2013 is independent from the residual for Sweden's growth for 2012; up to you to try to verify or justify it, but it has to be so for the estimator to work).

            What do you do with a matrix that is supposed to be a variance-covariance matrix, but isn't positive definite? Well, some implementations of the two-way clustering that I have seen simply replace the negative eigenvalues with zeroes, and do not say anything about doing so. However, zero is not good enough for Stata; an unstated convention is that a zero standard error is displayed as a missing value. The link you gave a month ago no longer works, so there isn't any way to really see what's going on.
            -- Stas Kolenikov || http://stas.kolenikov.name
            -- Principal Survey Scientist, Abt SRBI
            -- Opinions stated in this post are mine only

            Comment


            • #7
              Hi Skolenik,
              Thank you for your suggestions. I think that your suggestions imply that the missing value of GDPGrowth standard error is due to the cross-correlations between GDP Growth in particular countries in particular years with GDP growth of other countries in other years. Furthermore, I observe firms from 22 European countries and such cross-correlations are very probable. Am I correct?
              Regards,
              Ronny

              Comment

              Working...
              X