Announcement

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

  • DID FE and Cluster

    Hey,

    I have this code, where I try to regress my dependent variable RWA and my dummy, Time and Treated, and Time*Treated=DID. With all of the control variables.
    But, I remember how to use robust, but what if I want to cluster my data? And what does it exactly mean that I don't cluster it?

    reg RWA Time Treated DID Capitalization Deposits logGDP Inflation HHI Liquidity Size, robust

    Also I would like to know how to test for fixed effects. I hope someone can help me

  • #2
    Amalie:
    1) intead of -ronust-, you should select -vce(cluster clusterid)- option for your standard errors. Clustering (that is realiable if you have at least 30-50 clusters) acknowledge the standard errors for the autocorrelation of the residuals, assuming that clustered ovservation share some similarities;
    2) assuming that -Size- is a categorical variable and a potential fixed effect you want to test, you should plug in the right-habd side of your regression equation as -i.Size- and then test its joint statitical significance via -testparm-. The same holds for -i.Time-;
    3) in addition, your code can be made more efficient using -fvvarlist- notation:
    Code:
    reg RWA i.Time##i.Treated Capitalization Deposits logGDP Inflation HHI Liquidity i.Size, vce(cluster <yourclusterid>)
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you for reply.

      I now tried this before I saw your reply. reg RWA Time Treated DID Capitalization Deposits logGDP Inflation HHI Liquidity Size, cluster(RWA)

      Now im sorry if wierd question, but my clustered id is that the dependent variable?

      Also the size is the log (total asset ). Does that make any sense.

      Also when would you want to test for clustered id and fixed effects?

      Comment


      • #4
        Analie:
        1) your -clusterid- should be a predictor. Hence, your code in #3 is not correct;
        2) if -Size- is a continuous predictor, you cannot use the -i.- prefix;
        3) usually yoiu want to test the joint sttaistical significance of categorical predictors to decide whether to keep them in your regression or not.
        That said, fxed effect refers to panel data regression. However, in your case you do not seem to have to deal with this issue in your DID design.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thank you. RWA is my dependent variable, is the predictor a dependent or what could It be? perhaps year?

          Comment


          • #6
            Amalie:
            1) a predictor is, by definition, a independent variable;
            2) yes, -i.Year- is this -i.- form is a categorical predictor whose joint statistical significance you van test via -testparm-.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              aah okay thank you, I would love if you can take a look at this output and code, since im going to defence and I want to make sure I interpreted it correctly.

              Comment


              • #8
                See this below.

                The link is the framework I followed
                Attached Files
                The Difference-in-Difference estimation is a longitudinal study and is also known as the "controlled before-and-after study." Learn more about the test.

                Comment


                • #9
                  Amalie:
                  with all my deep symphathy, if your query is, at the end of the day, related to a term assigment or the like, please see https://www.statalist.org/forums/help#adviceextras #4.
                  That said, and provided that is the adjusted R_sq the tool to compare different OLS, If I were to choose one out of the three OLS, I would bet all in on #2.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Thank you

                    Comment

                    Working...
                    X