Announcement

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

  • i.year command ran for Fixed effects regression but results dropped

    Dear all,
    I ran the fixed effects regression and my code is as follows:
    xtset d_id monthlydate1 xi :xtreg AR lncaptial lnfeerate lnage i.year if d_sample3==1&t>=-12&t<=12,fe vce(robust)
    The code of "year" is :
    gen year=cond(y>=1999&y<=2004,1,0)
    replace year=2 if y>=2005&y<=2010
    replace year=3 if y>=2011&y<=2015
    replace year=4 if y>=2016&y<=2020
    The d_id is the name of my sample and the monthlydate1 is including the year+month (e.g.2014m1)
    Click image for larger version

Name:	2021-05-30 170347.png
Views:	1
Size:	125.8 KB
ID:	1612285

    Please tell me why the variables "_Iyear_2 _Iyear_3 _Iyear_4" are being dropped.
    Thank you.

  • #2
    Ketty:
    please share am example/excerpt of your dara via -dataex-. Thanks.
    Please note tha the -xi:- prefix is redundant.
    Eventually, it is probably more appropriate to remove social network links from your post. Thanks.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Carlo Lazzaro ,
      Thanks for your reminding, but i can't find the button to edit my post.
      The prefix of -xi:- is that i want to tell i did that code and i missed to press the enter.
      Click image for larger version

Name:	2021-05-30 201831.png
Views:	1
Size:	132.9 KB
ID:	1612306

      Last edited by Ketty Chih; 30 May 2021, 06:19.

      Comment


      • #4
        Ketty:
        screenshots are impossible to elaborate on and, as such, wisely discouraged by the FAQ.
        To post an exampe/excerpt of your data, please use -dataex- or use the #-shaped toggle from the advanced editor (A) toolbar.
        Code:
        this is the result of putting your data, code, whatever within CODE bounds
        That said:
        1) I'm unclear with your explanation cocnerning -xi:- prefix;
        2) please post an example/excerpt of your data containing -year- variable, too. Thanks.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Ketty:
          -xi:- prefix does not add anything to your code (as it is the case for all the canned Stata commands).
          Last edited by Carlo Lazzaro; 31 May 2021, 00:55.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            Carlo,
            year is :
            Code:
            gen year=cond(y>=1999&y<=2004,1,0)
            replace year=2 if y>=2005&y<=2010
            replace year=3 if y>=2011&y<=2015
            replace year=4 if y>=2016&y<=2020
            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input float(d_id d_sample3 AR lnage lncaptial lnfeerate year)
            1 .          .         .         .          . 3
            1 .          .         . 14.027865 -3.6119184 3
            1 1          .         0 13.711934 -2.3330443 3
            1 1   .5803861  .6931472   13.6827 -2.4304185 3
            1 1   3.675469 1.0986123  13.70369  -2.488915 3
            1 1  -2.410889 1.3862944 13.707518 -2.5510464 3
            1 1 -.13151123  1.609438  13.67305  -2.453408 3
            1 1   -3.23541 1.7917595 13.729343 -2.5383074 3
            1 1   1.254812   1.94591 13.778533  -2.525729 3
            1 1    .131283 2.0794415 13.879187   -2.56395 3
            end
            I'm new with stata, Thanks for your patience.
            Let me know if i miss any information

            Comment


            • #7
              Ketty:
              as per you data example, replicating your issue is unfeasible.
              As you provide one year only, the best approach is going OLS mimicking an -fe- specification by plugging in the -panelid- (that does not vary; as such, it refers to an unique panel only).
              That said:
              Code:
              . reg AR lncaptial lnfeerate lnage i.d_id i.year
              note: 1.d_id omitted because of collinearity
              note: 3.year omitted because of collinearity
              
                    Source |       SS           df       MS      Number of obs   =         7
              -------------+----------------------------------   F(3, 3)         =      0.63
                     Model |  12.2251122         3  4.07503739   Prob > F        =    0.6448
                  Residual |  19.5075174         3  6.50250581   R-squared       =    0.3853
              -------------+----------------------------------   Adj R-squared   =   -0.2295
                     Total |  31.7326296         6   5.2887716   Root MSE        =      2.55
              
              ------------------------------------------------------------------------------
                        AR |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                 lncaptial |   23.71878   22.57403     1.05   0.371    -48.12186    95.55942
                 lnfeerate |   30.85099   32.07198     0.96   0.407    -71.21638    132.9184
                     lnage |  -1.547011   3.368463    -0.46   0.677    -12.26696     9.17294
                    1.d_id |          0  (omitted)
                    3.year |          0  (omitted)
                     _cons |  -246.1281   285.3071    -0.86   0.452    -1154.103    661.8465
              ------------------------------------------------------------------------------
              
              .
              -d_id- and -year- are perfectly collinear and are therefore kicked out from the calculation.
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                Carlo Lazzaro :
                Thanks you for your help! Really appreciate what you've done.

                Comment

                Working...
                X