Announcement

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

  • F-Statistic for cluster robust standard error.

    The dataset I have has the following characteristics. The data deals with shareholder activism for 13 years, T=13. The cross-sections have sometimes repetitive observations, following table shows the how firms might have repeating values across the time period and with the year.
    Cross-section /Time 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
    Firm 3 7 6 9 7 4 6 5 4 6 6 5 6
    Firm 4 8 6 11 7 6 6 5 4 3 5 3
    Firm 5 1 6 7 7 3 5 7 4 6 5 5 6
    Firm 6 1 7 5 9 7 5 5 4 3 4 4
    Firm 7 7 5 6 5 1 2 3 2 4 4 8 3
    Firm 8 1 1 2 1 3 1 1
    Firm 9 1 2 3 1 1 1 1


    The dependent variable is Analyst Report (AR) form 'i' at for week 't' whereas Independent is Log( 1+News Articles the week )(lnnews) control variables including Total assets( LnTA) for the previous year, Leverage(LEV) Book to market(Mkbk). I am not sure which is an appropriate manner to run a regression. I am now using

    xi: regress AR lnnews lnTA Lev Mkbk i.Year i. Firm


    I want to have standard errors clustered at the firm level once I change the command to

    xi: regress AR lnnews lnTA Lev Mkbk i.Year i. Firm , vce (cluster Firm)


    The F-statistic goes missing.


    How to solve the issues, there are a total of 784 unique firms a total of 4564 firm-year observations for 13 years.

  • #2
    Welcome to the Stata Forum / Statalist,

    Please read the FAQ, particularly the topic about sharing data/command/output.

    Maybe sharing this information will be helpful to clarify the issue.

    That said, unless you're using a very old version of Stata, you won't need the prefix "xi".
    Best regards,

    Marcos

    Comment


    • #3
      Bilal:
      as an aside to Marcos' wise advice, see -help j_robustsingular-.
      Kind regards,
      Carlo
      (Stata 15.1 SE)

      Comment


      • #4
        Thank you for your responses, I had a look at the FAQs and I am hoping that I do a better job this time. The data deals with shareholder activism for 13 years, T=13. The cross-sections have sometimes repetitive observations, following table shows the how firms might have repeating values across the time period and within the same the year. The following table provides information about how the data is distributed across the years. For example firm 3 has 5 Analyst Reports(AR) in 2005 and 6 during 2016.

        Code:
         
        Cross-section /Time 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
        Firm 3 7 6 9 7 4 6 5 4 6 6 5 6
        Firm 4 8 6 11 7 6 6 5 4 3 5 3
        Firm 5 1 6 7 7 3 5 7 4 6 5 5 6
        Firm 6 1 7 5 9 7 5 5 4 3 4 4
        Firm 7 7 5 6 5 1 2 3 2 4 4 8 3
        Firm 8 1 1 2 1 3 1 1
        Code:
        xi: regress AR lnnews lnTA Lev Mkbk i.Year i. Firm
        The dependent variable is Analyst Report (AR) form 'i' at for week 't' whereas Independent is Log( 1+News Articles the week )(lnnews) control variables including Total assets( LnTA) for the previous year, Leverage(LEV) Book to market(Mkbk)

        I want to include firm and year fixed effects in regression when I use S.E clustered at the firm level there is no reported F-stat.
        Code:
        xi: regress AR lnnews lnTA Lev Mkbk i.Year i. Firm , vce (cluster Firm)
        I used 'xi:' as I have to use another string variable 'AR report type' i.e i.ARreportype if I don't use 'xi' it does not work gives an error message.
        Code:
        xi: regress AR lnnews lnTA Lev Mkbk i.Year i. Firm i.ARreportype
        Furthermore, I have tried various combinations of fixed effects, whenever I used vce (cluster Firm) in the equation in most cases there is no F-stat.

        Is there an alternative modeling method, can I use xtreg for this type of data.

        Furthermore, I had read of j_robustsingular, according to that it might be about degree of freedoms but I have no clue about how to calculate it in my case.
        Last edited by Bilal Hafeez; 15 Jun 2018, 00:51.

        Comment


        • #5
          This is a sample output here PERMNO is firm identifier
          Code:
          . xi: regress  ARreport lnews_10 lnta ReturnonAssets BooktoMarketRatio Leverage  i.Year i.PERMNO  ,vce(cl
          > uster PERMNO)
          i.Year            _IYear_2004-2016    (naturally coded; _IYear_2004 omitted)
          i.PERMNO          _IPERMNO_10104-93436(naturally coded; _IPERMNO_10104 omitted)
          
          Linear regression                               Number of obs     =      4,594
                                                          F(18, 783)        =          .
                                                          Prob > F          =          .
                                                          R-squared         =     0.6838
                                                          Root MSE          =     9.3237
          
                                              (Std. Err. adjusted for 784 clusters in PERMNO)
          -----------------------------------------------------------------------------------
                            |               Robust
                    ARreport|      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          ------------------+----------------------------------------------------------------
                   lnews_10 |   .5254691   .3330785     1.58   0.115    -.1283634    1.179302
                       lnta |  -.4482952   .9986625    -0.45   0.654    -2.408668    1.512078
             ReturnonAssets |  -.1251285   .0496914    -2.52   0.012    -.2226726   -.0275843
          BooktoMarketRatio |  -.0118422   .0174835    -0.68   0.498    -.0461623    .0224779
                   Leverage |   .0008755   .0008851     0.99   0.323    -.0008618    .0026129
          This is another case where I have excluded the i.PERMNO form equation

          Code:
            xi: regress  ARreport lnews_10  lnta ReturnonAssets BooktoMarketRatio Leverage  i.Year ,vce(cluster PERM
          > NO)
          i.Year            _IYear_2004-2016    (naturally coded; _IYear_2004 omitted)
          
          Linear regression                               Number of obs     =      4,594
                                                          F(19, 783)        =       6.57
                                                          Prob > F          =     0.0000
                                                          R-squared         =     0.1589
                                                          Root MSE          =     13.845
          
                                              (Std. Err. adjusted for 784 clusters in PERMNO)
          -----------------------------------------------------------------------------------
                            |               Robust
                    ARreport |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          ------------------+----------------------------------------------------------------
                   lnews_10 |   1.721232   .4309261     3.99   0.000     .8753245    2.567139
                       lnta |  -2.433996   .3273187    -7.44   0.000    -3.076522    -1.79147
             ReturnonAssets |  -.1102286   .0565688    -1.95   0.052    -.2212731    .0008158
          BooktoMarketRatio |  -.0819114   .0329707    -2.48   0.013    -.1466329   -.0171899
                   Leverage |   .0022335   .0011028     2.03   0.043     .0000687    .0043983
          In these case the degree of freedom reported value of F- stat is almost similar but no F-stat in the prior model but in the latter case the F-stat is 6.57.

          Comment


          • #6
            Billal:
            the first thing you should do to use -xtreg-, is using -reshape- to convert your data from -wide- to -long- format.
            Kind regards,
            Carlo
            (Stata 15.1 SE)

            Comment


            • #7
              Thank you Carlo Lazzaro,

              I think the data is already in a long shape, Please see the following table attached. Index_SVI is unique to each observation I have, whereas PERMNO is firm identifier and Year is the respective time period. You can also see the that there are repeated cross-sectional values form each firm in a given year (3007,3008 belong to the firm 10104 for same 2007), this makes it hard to declare it panel using xtset.

              Based on my research on various forums and research articles.

              i. I could just use the cross-sectional regression but the issue of F-stats I am not sure how to proceed.
              ii. Use xtreg, but I cannot declare the data to be panel because of the repeated cross-section in time.


              The command and error message for xtset is
              Code:
              xtset PERMNO Year
              repeated time values within panel
              Code:
                 
              Index_SVI PERMNO Year Arreport lnews_10 lnta ReturnonAssets BooktoMarketRatio Leverage
              3008 10104 2007 8.95 4.19 10.45 13.44 5.85 44.88
              3007 10104 2007 8.95 4.19 10.45 13.44 5.85 44.88
              3010 10104 2008 8.78 3.83 10.76 13.49 5.11 48.80
              3013 10104 2009 10.17 4.25 10.77 11.81 3.91 40.81
              3011 10104 2009 10.17 4.25 10.77 11.81 3.91 40.81
              3012 10104 2009 10.19 4.25 10.77 11.81 3.91 40.81
              3016 10104 2010 11.35 3.89 11.03 11.26 3.68 47.58
              3015 10104 2010 11.35 3.89 11.03 11.26 3.68 47.58
              3014 10104 2010 11.35 3.89 11.03 11.26 3.68 47.58
              7043 10104 2015 8.50 3.18 11.62 9.88 3.88 86.22
              7046 10104 2015 8.50 3.18 11.62 9.88 3.88 86.22
              7044 10104 2015 8.50 3.18 11.62 9.88 3.88 86.22
              7042 10104 2015 8.50 3.18 11.62 9.88 3.88 86.22
              7048 10104 2016 7.65 3.26 11.63 7.98 3.51 92.74
              2719 10107 2006 0.00 4.36 11.15 17.95 5.85 0.00
              2717 10107 2006 0.00 4.36 11.15 17.95 5.85 0.00
              2718 10107 2006 0.00 4.36 11.15 17.95 5.85 0.00
              2720 10107 2007 0.00 3.30 11.05 21.19 8.89 0.00
              2721 10107 2007 0.00 3.30 11.05 21.19 8.89 0.00
              2716 10107 2011 15.12 4.25 11.60 23.77 3.82 20.88
              5176 10107 2012 14.04 3.99 11.71 14.77 3.86 18.00
              6843 10107 2014 15.14 3.74 12.06 14.02 3.83 25.22
              6844 10107 2016 11.38 2.77 12.17 9.13 5.55 75.35
              2096 10145 2004 17.10 3.33 10.34 4.24 2.67 46.86
              2099 10145 2005 13.08 4.13 10.36 4.99 2.87 47.44
              2100 10145 2005 13.08 4.13 10.36 4.99 2.87 47.44
              2102 10145 2005 13.08 4.13 10.36 4.99 2.87 47.44
              2101 10145 2005 13.08 4.13 10.36 4.99 2.87 47.44
              2103 10145 2005 13.08 4.13 10.36 4.99 2.87 47.44
              2104 10145 2006 12.75 4.29 10.34 6.64 3.73 52.09
              2106 10145 2006 12.75 4.29 10.34 6.64 3.73 52.09
              6536 10145 2014 10.62 4.06 10.72 9.33 4.43 49.18
              6538 10145 2014 10.62 4.06 10.72 9.33 4.43 49.18
              6539 10145 2014 10.62 4.06 10.72 9.33 4.43 49.18
              6537 10145 2014 10.62 4.06 10.72 9.33 4.43 49.18
              6542 10145 2015 10.34 4.39 10.81 10.06 4.36 66.01
              6540 10145 2015 10.34 4.39 10.81 10.06 4.36 66.01

              Your input is highly valued, thank you very much

              Comment


              • #8
                Bilal:
                -please use -dataex- to share example/excerpt of you dataset.
                That said:
                - -regress- rarely outperforms -xtreg- when it comes to panel data analysis;
                - if you do not plan to use time-series commands, such as leads and lags, you can -xtset- your data using the -panelid- only.
                Last edited by Carlo Lazzaro; 15 Jun 2018, 04:15.
                Kind regards,
                Carlo
                (Stata 15.1 SE)

                Comment


                • #9
                  Carlo gave excellent advice. Just a side note: it seems you have duplicates, according to the way the - xtset - was done. You can check it out with - duplicates - command.
                  Best regards,

                  Marcos

                  Comment

                  Working...
                  X