Announcement

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

  • Panel data analysis with entity and time fixed effects and with small N, large T

    Hello everybody,

    I'm trying to analyze the effect of various labour market statistics (eg. unemployment rate, employment-to-population ratio, manufacturing share of employment, etc.) individually on the monthly per-capita rate of drug abuse incidents in 11 regions across 12 years (N=11, T=144). That is, I want to compare how changes in each statistic affect the rate of incidents in that region in that month by testing this relationship one labour market statistics at a time, and then perhaps with several statistics at a time that are less likely to be be collinear (eg. unemployment rate and manufacturing employment share). I want to use both region and time fixed effects to account for confounding factors that vary across regions but not over time, as well as factors that vary over time but not across regions.

    So far I have been using the following regression:
    (first used: xtset region yearmonth, monthly)

    xtreg ratedeath labmarketvar i.yearmonth, fe robust
    However, I have not had the results I expected (ie. the p-values are all extremely high). Is this the right way to go about this panel data analysis? I worry my unexpected results (ie. finding no effect) have to do with the small N, large T characteristics of my dataset given that panel data usually deals with large N, small T datasets.

    Separately, I'm wondering whether it is possible to use 3, 6, or 12 month moving averages for my independent and dependent variables in this regression (hoping this would help find better results)--or would using moving averages damage the validity of this regression (eg. because of the autocorrelation inherent in moving averages)?

    It is also tedious to scroll through all 143 dummy time variables while viewing the results, so if there is any way to suppress those indicator variables from being reported in the regression results that would be very much appreciated.

    Thank you in advance for the help!

  • #2
    Jacb:
    welcome to the list.
    you did not post what you got from Stata; that makes difficult (for me, at any rate) to advise positively.
    Anyway, you're seemingly dealing with a small N, a bit larger T panel dataset.
    I would try -xtgls-, instead.
    Admittedly, I do not folow your second question concerning moving average.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Specifically on the question of suppressing the coefficients of 143 dummy variables, you may want to look at Sergio Correia's reghdfe available from SSC, which has the added advantage of being very fast.

      Comment


      • #4
        Thank you Carlo and German for your helpful replies. My apologies for not posting my Stata results originally, I have included some below (sorry I could not figure how to copy and paste them cleaner).

        German, I will check out -reghdfe-.

        Carlo, I have tried -xtgls- and obtained much better results. You can ignore my question about moving averages for now. But a few questions about -xtgls-

        1) Can I continue to use entity and time fixed effects with a -xtgls- panel data regression, as below?

        Code:
        xtgls rateed unemprate i.ymtime i.region
        
        Cross-sectional time-series FGLS regression
        
        Coefficients:  generalized least squares
        Panels:        homoskedastic
        Correlation:   no autocorrelation
        
        Estimated covariances      =         1          Number of obs     =      1,584
        Estimated autocorrelations =         0         Number of groups  =         11
        Estimated coefficients     =       155          Time periods      =        144
                                                                         Wald chi2(154)    =    1877.88
        Log likelihood             = -1754.705           Prob > chi2       =     0.0000
        
        ---------------------------------------------------------------------------------------------------
                     rateed |      Coef.         Std. Err.      z      P>|z|     [95% Conf. Interval]
        ----------------------------------+----------------------------------------------------------------
              unemprate |  -4.104528   2.250921    -1.82   0.068    -8.516253    .3071963
        (NB I have not included the results for the many region and time fixed effect dummy variables)

        2) Is having a small N, larger T panel dataset sufficient cause for using -xtgls- (rather than -xtreg-) or must I also test for autocorrelation (if so, how should I test)?


        By the way, these are the Stata results which prompted my question in my original post:

        I obtained good results from this regression with -xtreg- :
        Code:
        xtreg rateed empratio, fe robust
        
        Fixed-effects (within) regression               Number of obs     =      1,584
        Group variable: region                              Number of groups  =         11
        
        R-sq:                                           Obs per group:
             within  = 0.0446                                         min =        144
             between = 0.4510                                         avg =      144.0
             overall = 0.1840                                         max =        144
        
                                                                      F(1,10)           =      18.96
        corr(u_i, Xb)  = 0.2241                         Prob > F          =     0.0014
        
                                            (Std. Err. adjusted for 11 clusters in er)
        ------------------------------------------------------------------------------
                         |               Robust
              rateed |      Coef.   Std. Err.                t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
           empratio |  -8.712886      2.001      -4.35   0.001    -13.17139   -4.254379
               _cons |   7.587658   1.202233     6.31   0.000     4.908915     10.2664
        -------------+----------------------------------------------------------------
             sigma_u |  .51794828
             sigma_e |   .8549781
                 rho |  .26846963   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        But when I included time fixed effects (ymtime) the results were not good--for example, a p-value of 0.939 and much smaller coefficient than above:

        Code:
         xtreg rateed empratio i.yearmonth, fe robust
        
        Fixed-effects (within) regression               Number of obs     =      1,584
        Group variable: region                              Number of groups  =         11
        
        R-sq:                                           Obs per group:
             within  = 0.2917                                         min =        144
             between = 0.4510                                         avg =      144.0
             overall = 0.1944                                         max =        144
        
                                                                     F(10,10)          =          .
        corr(u_i, Xb)  = 0.0108                         Prob > F          =          .
        
                                            (Std. Err. adjusted for 11 clusters in er)
        ------------------------------------------------------------------------------
                         |               Robust
              rateed |          Coef.   Std. Err.           t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
          empratio |  -.2194941   2.782655    -0.08   0.939    -6.419636    5.980647
        (NB Again I have not included the results for the many time fixed effect dummy variables)

        I figured that perhaps the model was over-specified when including both time and region fixed effects, and/or perhaps it was an issue with using -xtreg- with a small N, larger T dataset. The results obtained using -xtgls- are much better, if that is a valid approach in my case.

        Thank you again for all the help and please let me know if there is any other information I should include.

        Best regards,

        Jacob

        Comment


        • #5
          With the latest model you show (FE with year FE), what is the output produced by:
          testparm i.year?

          Comment


          • #6
            Jacob:
            a1) you shoud investigate both heteroskedasticity and autocorrelation in your data and model the latter accordingly (see -xtgls- options);
            a2) when T>N, -xtgls- is the way to go; see a1) about the need of investigating autocorrelation and specifying your model accordingly.

            As an aside, please take a look at -help j_robustsingular- for explanations about missing F-test in your last regression model.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Thank you Ariel and Carlo again for the helpful answers.

              Ariel: Assuming by "i.year" you meant my time indicator variable, i.ymtime:
              Code:
              . testparm i.ymtime
              
               ( 1)  541.ymtime = 0
               ( 2)  542.ymtime = 0
               ( 3)  543.ymtime = 0
               ( 4)  544.ymtime = 0
               ( 5)  545.ymtime = 0
               ( 6)  546.ymtime = 0
               ( 7)  547.ymtime = 0
               ( 8)  548.ymtime = 0
               ( 9)  549.ymtime = 0
               (10)  550.ymtime = 0
               (11)  551.ymtime = 0
               (12)  552.ymtime = 0
               (13)  553.ymtime = 0
               (14)  554.ymtime = 0
               (15)  555.ymtime = 0
               (16)  556.ymtime = 0
               (17)  557.ymtime = 0
               (18)  558.ymtime = 0
               (19)  559.ymtime = 0
               (20)  560.ymtime = 0
               (21)  561.ymtime = 0
               (22)  562.ymtime = 0
               (23)  563.ymtime = 0
               (24)  564.ymtime = 0
               (25)  565.ymtime = 0
               (26)  566.ymtime = 0
               (27)  567.ymtime = 0
               (28)  568.ymtime = 0
               (29)  569.ymtime = 0
               (30)  570.ymtime = 0
               (31)  571.ymtime = 0
               (32)  572.ymtime = 0
               (33)  573.ymtime = 0
               (34)  574.ymtime = 0
               (35)  575.ymtime = 0
               (36)  576.ymtime = 0
               (37)  577.ymtime = 0
               (38)  578.ymtime = 0
               (39)  579.ymtime = 0
               (40)  580.ymtime = 0
               (41)  581.ymtime = 0
               (42)  582.ymtime = 0
               (43)  583.ymtime = 0
               (44)  584.ymtime = 0
               (45)  585.ymtime = 0
               (46)  586.ymtime = 0
               (47)  587.ymtime = 0
               (48)  588.ymtime = 0
               (49)  589.ymtime = 0
               (50)  590.ymtime = 0
               (51)  591.ymtime = 0
               (52)  592.ymtime = 0
               (53)  593.ymtime = 0
               (54)  594.ymtime = 0
               (55)  595.ymtime = 0
               (56)  596.ymtime = 0
               (57)  597.ymtime = 0
               (58)  598.ymtime = 0
               (59)  599.ymtime = 0
               (60)  600.ymtime = 0
               (61)  601.ymtime = 0
               (62)  602.ymtime = 0
               (63)  603.ymtime = 0
               (64)  604.ymtime = 0
               (65)  605.ymtime = 0
               (66)  606.ymtime = 0
               (67)  607.ymtime = 0
               (68)  608.ymtime = 0
               (69)  609.ymtime = 0
               (70)  610.ymtime = 0
               (71)  611.ymtime = 0
               (72)  612.ymtime = 0
               (73)  613.ymtime = 0
               (74)  614.ymtime = 0
               (75)  615.ymtime = 0
               (76)  616.ymtime = 0
               (77)  617.ymtime = 0
               (78)  618.ymtime = 0
               (79)  619.ymtime = 0
               (80)  620.ymtime = 0
               (81)  621.ymtime = 0
               (82)  622.ymtime = 0
               (83)  623.ymtime = 0
               (84)  624.ymtime = 0
               (85)  625.ymtime = 0
               (86)  626.ymtime = 0
               (87)  627.ymtime = 0
               (88)  628.ymtime = 0
               (89)  629.ymtime = 0
               (90)  630.ymtime = 0
               (91)  631.ymtime = 0
               (92)  632.ymtime = 0
               (93)  633.ymtime = 0
               (94)  634.ymtime = 0
               (95)  635.ymtime = 0
               (96)  636.ymtime = 0
               (97)  637.ymtime = 0
               (98)  638.ymtime = 0
               (99)  639.ymtime = 0
               (100)  640.ymtime = 0
               (101)  641.ymtime = 0
               (102)  642.ymtime = 0
               (103)  643.ymtime = 0
               (104)  644.ymtime = 0
               (105)  645.ymtime = 0
               (106)  646.ymtime = 0
               (107)  647.ymtime = 0
               (108)  648.ymtime = 0
               (109)  649.ymtime = 0
               (110)  650.ymtime = 0
               (111)  651.ymtime = 0
               (112)  652.ymtime = 0
               (113)  653.ymtime = 0
               (114)  654.ymtime = 0
               (115)  655.ymtime = 0
               (116)  656.ymtime = 0
               (117)  657.ymtime = 0
               (118)  658.ymtime = 0
               (119)  659.ymtime = 0
               (120)  660.ymtime = 0
               (121)  661.ymtime = 0
               (122)  662.ymtime = 0
               (123)  663.ymtime = 0
               (124)  664.ymtime = 0
               (125)  665.ymtime = 0
               (126)  666.ymtime = 0
               (127)  667.ymtime = 0
               (128)  668.ymtime = 0
               (129)  669.ymtime = 0
               (130)  670.ymtime = 0
               (131)  671.ymtime = 0
               (132)  672.ymtime = 0
               (133)  673.ymtime = 0
               (134)  674.ymtime = 0
               (135)  675.ymtime = 0
               (136)  676.ymtime = 0
               (137)  677.ymtime = 0
               (138)  678.ymtime = 0
               (139)  679.ymtime = 0
               (140)  680.ymtime = 0
               (141)  681.ymtime = 0
               (142)  682.ymtime = 0
               (143)  683.ymtime = 0
                     Constraint 1 dropped
                     Constraint 2 dropped
                     Constraint 3 dropped
                     Constraint 4 dropped
                     Constraint 5 dropped
                     Constraint 6 dropped
                     Constraint 7 dropped
                     Constraint 8 dropped
                     Constraint 9 dropped
                     Constraint 10 dropped
                     Constraint 12 dropped
                     Constraint 13 dropped
                     Constraint 14 dropped
                     Constraint 15 dropped
                     Constraint 16 dropped
                     Constraint 17 dropped
                     Constraint 18 dropped
                     Constraint 19 dropped
                     Constraint 20 dropped
                     Constraint 21 dropped
                     Constraint 23 dropped
                     Constraint 24 dropped
                     Constraint 25 dropped
                     Constraint 26 dropped
                     Constraint 28 dropped
                     Constraint 29 dropped
                     Constraint 30 dropped
                     Constraint 31 dropped
                     Constraint 32 dropped
                     Constraint 33 dropped
                     Constraint 34 dropped
                     Constraint 35 dropped
                     Constraint 36 dropped
                     Constraint 37 dropped
                     Constraint 38 dropped
                     Constraint 39 dropped
                     Constraint 40 dropped
                     Constraint 41 dropped
                     Constraint 42 dropped
                     Constraint 43 dropped
                     Constraint 44 dropped
                     Constraint 45 dropped
                     Constraint 46 dropped
                     Constraint 47 dropped
                     Constraint 48 dropped
                     Constraint 49 dropped
                     Constraint 50 dropped
                     Constraint 51 dropped
                     Constraint 52 dropped
                     Constraint 53 dropped
                     Constraint 54 dropped
                     Constraint 55 dropped
                     Constraint 56 dropped
                     Constraint 57 dropped
                     Constraint 58 dropped
                     Constraint 59 dropped
                     Constraint 60 dropped
                     Constraint 62 dropped
                     Constraint 63 dropped
                     Constraint 64 dropped
                     Constraint 65 dropped
                     Constraint 66 dropped
                     Constraint 67 dropped
                     Constraint 68 dropped
                     Constraint 69 dropped
                     Constraint 70 dropped
                     Constraint 71 dropped
                     Constraint 72 dropped
                     Constraint 73 dropped
                     Constraint 74 dropped
                     Constraint 75 dropped
                     Constraint 76 dropped
                     Constraint 77 dropped
                     Constraint 78 dropped
                     Constraint 79 dropped
                     Constraint 80 dropped
                     Constraint 81 dropped
                     Constraint 82 dropped
                     Constraint 83 dropped
                     Constraint 84 dropped
                     Constraint 85 dropped
                     Constraint 86 dropped
                     Constraint 87 dropped
                     Constraint 88 dropped
                     Constraint 89 dropped
                     Constraint 90 dropped
                     Constraint 91 dropped
                     Constraint 92 dropped
                     Constraint 93 dropped
                     Constraint 94 dropped
                     Constraint 95 dropped
                     Constraint 96 dropped
                     Constraint 97 dropped
                     Constraint 98 dropped
                     Constraint 99 dropped
                     Constraint 100 dropped
                     Constraint 101 dropped
                     Constraint 103 dropped
                     Constraint 104 dropped
                     Constraint 105 dropped
                     Constraint 106 dropped
                     Constraint 107 dropped
                     Constraint 109 dropped
                     Constraint 110 dropped
                     Constraint 111 dropped
                     Constraint 112 dropped
                     Constraint 113 dropped
                     Constraint 114 dropped
                     Constraint 115 dropped
                     Constraint 116 dropped
                     Constraint 117 dropped
                     Constraint 118 dropped
                     Constraint 119 dropped
                     Constraint 120 dropped
                     Constraint 121 dropped
                     Constraint 123 dropped
                     Constraint 124 dropped
                     Constraint 125 dropped
                     Constraint 126 dropped
                     Constraint 127 dropped
                     Constraint 128 dropped
                     Constraint 129 dropped
                     Constraint 130 dropped
                     Constraint 131 dropped
                     Constraint 132 dropped
                     Constraint 133 dropped
                     Constraint 135 dropped
                     Constraint 136 dropped
                     Constraint 137 dropped
                     Constraint 138 dropped
                     Constraint 139 dropped
                     Constraint 141 dropped
                     Constraint 142 dropped
              
                         chi2( 10) =   95.57
                       Prob > chi2 =    0.0000
              I'm not sure what to conclude from this test...

              Carlo: Thank you, I will test for heteroskedasticity and autocorrelation and adjust the model accordingly for the latter. The instructions here seem like a good process: https://www.stata.com/support/faqs/s...tocorrelation/

              Thank you also for the advice that if T>N I should use -xtgls- rather than -xtreg-. Is it possible for you to provide me with a a reference that I can cite with this information?

              Comment


              • #8
                Jacob:
                you may want to take a look at: https://www.stata.com/bookstore/micr...metrics-stata/ (pages 273-276).
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Thank you Carlo for that reference, and for all the other help as well. Much appreciated!

                  Comment

                  Working...
                  X