Announcement

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

  • #16
    Thank you so much Clyde.

    I decided to use 3 level pre_post.

    However, if I use
    xtreg outcome i.treated##i.pre_post,r
    it is random-effect model.

    Since it is panel data, I needed to test hausman test. then it showed fixed effect model was suitable.
    but if I use fixed effect "fe" command, I could not do margins(not estimable).

    Comment


    • #17
      Ah, yes, I forgot about that. -margins- has a -noestimcheck- option that will cause Stata to ignore the situation that provokes this message. One shouldn't do this haphazardly, but this particular situation, a fixed-effects estimation with a key variable (treatment) that is time-invariant within panels, it won't cause problems. So just add -noestimcheck- to the options of your -margins- commands and proceed.

      Comment


      • #18
        By using factor-variable in fixed effect model, I run as follow.

        Code:
        xtreg log_Ab i.treated##i.pre_post, fe
        This results looked ok.

        However, when I run another code as below, it came out something I don't understand.
        I used three kinds of factor variable in one model (treated, land type dummy, paddy feild dummy and) and other variables, like NF, PT and so on.

        Code:
        log_Ab i.treated##i.pre_post i.landtypeD##i.pre_post i.paddyD##i.pre_post NF PT Over BG, fe
        The results says that
        note: 1.treated omitted because of collinearity
        note: 1.treated#2.pre_post omitted because of collinearity
        note: 1.landtypeD omitted because of collinearity
        note: 1.paddyD omitted because of collinearity
        in the result table, it say (empty) or (omitted)
        HTML Code:
        ----------------------------------------------------------------------------------
                    log_Ab |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------------+----------------------------------------------------------------
                 1.treated |          0  (omitted)
                           |
                  pre_post |
                        1  |  -.4966127   .1448349    -3.43   0.001    -.7823035   -.2109219
                        2  |  -.5374133    .172886    -3.11   0.002    -.8784359   -.1963907
                           |
          treated#pre_post |
                      1 0  |          0  (empty)
                      1 1  |  -.0424136   .1626429    -0.26   0.795    -.3632314    .2784042
                      1 2  |          0  (omitted)
                           |
               1.landtypeD |          0  (omitted)
                           |
        landtypeD#pre_post |
                      1 1  |   .2097202   .1789973     1.17   0.243    -.1433571    .5627975
                      1 2  |   .3128891   .1844963     1.70   0.092    -.0510349    .6768132
                           |
                  1.paddyD |          0  (omitted)
                           |
           paddyD#pre_post |
                      1 1  |  -.0960701   .4149029    -0.23   0.817    -.9144779    .7223376
                      1 2  |   .2782761   .4240689     0.66   0.512    -.5582118    1.114764
                           |
              NF           |  -.0015381   .0008993    -1.71   0.089     -.003312    .0002359
                 PT        |  -.2455001    .602126    -0.41   0.684    -1.433211    .9422105
                   Over   |  -1.270293   .6120589    -2.08   0.039    -2.477596   -.0629891
                    BG     |   2.40e-07   7.36e-07     0.33   0.745    -1.21e-06    1.69e-06
                     _cons |  -2.914958   .4043729    -7.21   0.000    -3.712595   -2.117322
        -------------------+----------------------------------------------------------------
                   sigma_u |  1.6678854
                   sigma_e |  .53919452
                       rho |  .90537872   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------------
        F test that all u_i=0:     F(157, 190) =    12.23            Prob > F = 0.0000

        I understand why dummy omitted, it may be because group dummy, landtype dummy and paddy field dummy are always the same (time-invariant) over time.

        but I don't know why the third variable -treated#pre_post( 1, 0) became empty, and 1,2 omitted.

        thank you,

        Comment


        • #19
          Well, this would have happened if, at least after discarding all observations that are missing any of the other variables in your model, there are no observations that have treated == 1 & pre_post == 0. With that category of the interaction being empty, Stata then has to select a different level of the interaction as the reference (omitted) category, and so it selected 1.treated#2.pre_post for that and, therefore, omitted it.

          To confirm that this is what happened run
          Code:
          tab treated pre_post if !missing(landtypeD, paddyD, NF, PT, Over, BG)
          and you will see a zero in the treated == 1, pre_post = 0 cell.

          Then you have to decide whether this is an error in your data that needs to be fixed, or a reality based limitation that must be lived with.

          Comment


          • #20
            Thank you so much for prompt reply.

            I tried the code you have just suggested.

            HTML Code:
                     |             pre_post
               treated |         0          1          2 |     Total
            -----------+---------------------------------+----------
                     0 |        70         69         69 |       208 
                     1 |        91         91         94 |       276 
            -----------+---------------------------------+----------
                 Total |       161        160        163 |       484 
            it seems not about data error then.

            Comment


            • #21
              For further troubleshooting I think you need to post an example of the data. (Be sure to use -dataex- to do that. If you are not familiar with -dataex-, read FAQ #12).

              Comment


              • #22
                As doctor Schechter recommended I used factor-variable notation and -margins-. I got results which was quite clear.

                Could it be the same results as DID though? I mean in my paper, I try to examine effect of policy using Panel data and treatment group and controlled group 3 time periods. I used to mention how DID works in the model.

                If this factoral variables notation is the same meaning as DID, is it right I still mentioned DID in the paper?

                Comment

                Working...
                X