Announcement

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

  • Newey-West SE - no observations error

    Hello, I am experiencing problems with estimating SE with Newey-West for certain variables.
    I use the command newey, with the option force and lag(2) (Stata 18).

    I have attached an example of my dataset below (panel dataset):

    Code:
    Panel variable: country_id (unbalanced)
     Time variable: date, 1991q1 to 2022q4, but with gaps
             Delta: 1 quarter
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float country_id str52 country float(date year re1 re2 re3 FE5 FE6)
    1 "Argentina" 152 1998         .         .         .          .           .
    1 "Argentina" 153 1998 1.3166667       2.2       1.6       2.57   .53642154
    1 "Argentina" 154 1998         .         .         .          .           .
    1 "Argentina" 155 1998 1.1870365       1.6       1.6       2.57   .53642154
    1 "Argentina" 156 1999         .         .         .          .           .
    1 "Argentina" 157 1999 1.1870365       1.6       1.6       2.57   .53642154
    1 "Argentina" 158 1999         .         .         .          .           .
    1 "Argentina" 159 1999 1.1870365       1.6       1.6       2.57   .53642154
    1 "Argentina" 160 2000         .         .         .          .           .
    1 "Argentina" 161 2000 1.1870365       1.6       1.6       2.57   .53642154
    1 "Argentina" 162 2000         .         .         .          .           .
    1 "Argentina" 163 2000 1.1870365       1.6       1.6       2.57   .53642154
    1 "Argentina" 164 2001         .         .         .          .           .
    1 "Argentina" 165 2001 1.1870365       1.6       1.6       2.57   .53642154
    1 "Argentina" 166 2001         .         .         .          .           .
    1 "Argentina" 167 2001 1.1870365       1.6       1.6       2.57   .53642154
    1 "Argentina" 168 2002         .         .         .          .           .
    1 "Argentina" 169 2002 10.010653  9.379013       7.8 .029999733   -.4731998
    1 "Argentina" 170 2002         .         .         .          .           .
    1 "Argentina" 171 2002 10.010653  9.379013       7.8  -2.540433   -1.663059
    1 "Argentina" 172 2003         .         .         .          .           .
    1 "Argentina" 173 2003 10.010653  9.379013       7.8      2.385   .53642154
    1 "Argentina" 174 2003         .         .         .          .           .
    1 "Argentina" 175 2003  7.885714       8.5       6.8       2.57   .53642154
    1 "Argentina" 176 2004         .         .         .          .           .
    1 "Argentina" 177 2004  7.268264       5.4       4.5       2.57           .
    1 "Argentina" 178 2004         .         .         .          .           .
    1 "Argentina" 179 2004  7.764472       8.6       7.8  -2.540433           .
    1 "Argentina" 180 2005         .         .         .          .           .
    1 "Argentina" 181 2005  8.074825    8.0275   7.34225       2.57           .
    1 "Argentina" 182 2005         .         .         .          .           .
    1 "Argentina" 183 2005 10.010653  9.379013       7.8       2.57           .
    1 "Argentina" 184 2006         .         .         .          .           .
    1 "Argentina" 185 2006 10.010653  9.379013       7.8  1.5386362           .
    1 "Argentina" 186 2006         .         .         .          .           .
    1 "Argentina" 187 2006 10.010653  9.379013       7.8   1.693571           .
    1 "Argentina" 188 2007         .         .         .          .           .
    1 "Argentina" 189 2007 10.010653  9.379013       7.8   1.571719           .
    1 "Argentina" 190 2007         .         .         .          .           .
    1 "Argentina" 191 2007 10.010653  9.379013       7.8   .7230711           .
    1 "Argentina" 192 2008         .         .         .          .           .
    1 "Argentina" 193 2008 10.010653  9.379013       7.8       2.57           .
    1 "Argentina" 194 2008         .         .         .          .           .
    1 "Argentina" 195 2008 10.010653  9.379013       7.8   2.468856           .
    1 "Argentina" 196 2009         .         .         .          .           .
    1 "Argentina" 197 2009  7.920622  9.379013       7.8          .           .
    1 "Argentina" 198 2009         .         .         .          .           .
    1 "Argentina" 199 2009   8.23325  8.532306       7.8          .           .
    1 "Argentina" 200 2010         .         .         .          .           .
    1 "Argentina" 201 2010 10.010653  9.379013       7.8          .           .
    1 "Argentina" 202 2010         .         .         .          .           .
    1 "Argentina" 203 2010 10.010653  9.379013       7.8          .           .
    1 "Argentina" 204 2011         .         .         .          .           .
    1 "Argentina" 205 2011 10.010653  9.379013       7.8          .           .
    1 "Argentina" 206 2011         .         .         .          .           .
    1 "Argentina" 207 2011 10.010653  9.379013       7.8          .           .
    1 "Argentina" 208 2012         .         .         .          .           .
    1 "Argentina" 209 2012 10.010653  9.379013       7.8       2.57           .
    1 "Argentina" 210 2012         .         .         .          .           .
    1 "Argentina" 211 2012 10.010653      9.25       7.8       2.57           .
    1 "Argentina" 212 2013         .         .         .          .           .
    1 "Argentina" 213 2013 10.010653  9.379013       7.8       2.57           .
    1 "Argentina" 214 2013         .         .         .          .           .
    1 "Argentina" 215 2013 10.010653  9.379013       7.8       2.57           .
    1 "Argentina" 228 2017 10.010653  9.379013  7.524577          .           .
    1 "Argentina" 229 2017 10.010653  9.379013       7.8          .           .
    1 "Argentina" 230 2017 10.010653  9.379013       7.8          .           .
    1 "Argentina" 231 2017 10.010653  9.379013       7.8          .           .
    1 "Argentina" 232 2018 10.010653  9.379013  6.999327          .           .
    1 "Argentina" 233 2018 10.010653  9.379013  7.352464          .           .
    1 "Argentina" 234 2018 10.010653  9.379013       7.8          .           .
    1 "Argentina" 235 2018 10.010653  9.379013       7.8          .           .
    1 "Argentina" 240 2020 10.010653  9.379013       7.8          .           .
    1 "Argentina" 241 2020 10.010653  9.379013       7.8          .           .
    1 "Argentina" 242 2020 10.010653  9.379013       7.8          .           .
    1 "Argentina" 243 2020 10.010653  9.379013       7.8          .           .
    1 "Argentina" 244 2021 10.010653  9.379013       7.8          .           .
    1 "Argentina" 245 2021 10.010653  9.379013       7.8          .           .
    1 "Argentina" 246 2021 10.010653  9.379013       7.8          .           .
    1 "Argentina" 247 2021 10.010653  9.379013       7.8          .           .
    2 "Australia" 124 1991         .         .         .          .           .
    2 "Australia" 125 1991  5.283333       5.4       5.5  -2.165808   -1.663059
    2 "Australia" 126 1991         .         .         .          .           .
    2 "Australia" 127 1991   4.18125       4.8       4.9 -2.2658079   -1.663059
    2 "Australia" 128 1992         .         .         .          .           .
    2 "Australia" 129 1992  4.346667       4.8       4.6  -2.540433   -1.663059
    2 "Australia" 130 1992         .         .         .          .           .
    2 "Australia" 131 1992      3.12       3.9         4  -2.540433    -.863059
    2 "Australia" 132 1993         .         .         .          .           .
    2 "Australia" 133 1993  3.342857       4.1       3.9  -2.540433  -.28861284
    2 "Australia" 134 1993         .         .         .          .           .
    2 "Australia" 135 1993       3.3       3.9       3.9  -2.540433  -.38861275
    2 "Australia" 136 1994         .         .         .          .           .
    2 "Australia" 137 1994   3.45625       3.8       3.2  -1.654435 -.009200573
    2 "Australia" 138 1994         .         .         .          .           .
    2 "Australia" 139 1994 3.6833334       3.8       3.7 -2.3544352   -.3092005
    2 "Australia" 140 1995         .         .         .          .           .
    2 "Australia" 141 1995 4.4266667         4       3.4   .1572175   -.8655608
    2 "Australia" 142 1995         .         .         .          .           .
    2 "Australia" 143 1995 4.1235294       3.5       3.3   .7572176  -.26556063
    2 "Australia" 144 1996         .         .         .          .           .
    2 "Australia" 145 1996  3.330769       3.1       3.6  1.4070678  -.03604555
    2 "Australia" 146 1996         .         .         .          .           .
    2 "Australia" 147 1996  2.235294         3         3  2.0070677  -.03604555
    2 "Australia" 148 1997         .         .         .          .           .
    2 "Australia" 149 1997 3.0266666       3.6       3.7   .2152872  -.27074194
    2 "Australia" 150 1997         .         .         .          .           .
    2 "Australia" 151 1997 1.5578947       3.2       3.4   .9152873   .02925801
    2 "Australia" 152 1998         .         .         .          .           .
    2 "Australia" 153 1998 2.6166666       2.9       2.6 .031797886    .3527284
    2 "Australia" 154 1998         .         .         .          .           .
    2 "Australia" 155 1998  2.635714       2.7       2.7  .13179803   .53642154
    2 "Australia" 156 1999         .         .         .          .           .
    2 "Australia" 157 1999 2.9842105       3.2       2.4 -.15737247    .4383147
    2 "Australia" 158 1999         .         .         .          .           .
    2 "Australia" 159 1999 3.6235294       3.3       2.4 -.25737238    .3383148
    2 "Australia" 160 2000         .         .         .          .           .
    2 "Australia" 161 2000    3.7125       2.3       2.5  .17541575    .4813654
    2 "Australia" 162 2000         .         .         .          .           .
    2 "Australia" 163 2000 3.9411764       2.4       2.5  .17541575    .4813654
    2 "Australia" 164 2001         .         .         .          .           .
    2 "Australia" 165 2001 2.0555556       2.4       2.6   1.254644   .53642154
    2 "Australia" 166 2001         .         .         .          .           .
    2 "Australia" 167 2001 2.3266666       2.4       2.6    .954644   .53642154
    2 "Australia" 168 2002         .         .         .          .           .
    2 "Australia" 169 2002  2.488235       2.8       2.6  .04180574    .4129386
    2 "Australia" 170 2002         .         .         .          .           .
    2 "Australia" 171 2002 2.4642856       2.5       2.7  -.2581942    .3129387
    2 "Australia" 172 2003         .         .         .          .           .
    2 "Australia" 173 2003 2.3266666       2.6       2.7   1.949149   -.0669024
    2 "Australia" 174 2003         .         .         .          .           .
    2 "Australia" 175 2003  2.194737       2.5       2.6  1.8491492   -.0669024
    2 "Australia" 176 2004         .         .         .          .           .
    2 "Australia" 177 2004  2.510447       2.8       2.7  -.6294415    .0790782
    2 "Australia" 178 2004         .         .         .          .           .
    2 "Australia" 179 2004  2.490306       2.6       2.8 -.52944136    .0790782
    2 "Australia" 180 2005         .         .         .          .           .
    2 "Australia" 181 2005   2.70417  2.605566  2.531389    .442018  -.25864077
    2 "Australia" 182 2005         .         .         .          .           .
    2 "Australia" 183 2005  2.801514  2.673648  2.532876   .3881683   -.2275324
    2 "Australia" 184 2006         .         .         .          .           .
    2 "Australia" 185 2006 2.6701126       2.6       2.4   .7299252    -.710305
    2 "Australia" 186 2006         .         .         .          .           .
    2 "Australia" 187 2006  2.749015       2.5       2.5   .8299251    -.710305
    2 "Australia" 188 2007         .         .         .          .           .
    2 "Australia" 189 2007   2.63667  2.538597  2.495804  -.8661731   -.6388891
    2 "Australia" 190 2007         .         .         .          .           .
    2 "Australia" 191 2007  2.862896 2.6898844 2.5755935  -.8626343   -.6580622
    2 "Australia" 192 2008         .         .         .          .           .
    2 "Australia" 193 2008  2.800906   2.67374  2.649201 -.10009956   -.7318434
    2 "Australia" 194 2008         .         .         .          .           .
    2 "Australia" 195 2008 3.2046685 2.5556126  2.559372 -.07677794   -.6375893
    2 "Australia" 196 2009         .         .         .          .           .
    2 "Australia" 197 2009 2.3689988  2.634605  2.656809 -.01495099   -.8346231
    2 "Australia" 198 2009         .         .         .          .           .
    2 "Australia" 199 2009 2.3234437 2.5769064 2.7174635  -.1463213  -1.0284765
    2 "Australia" 200 2010         .         .         .          .           .
    2 "Australia" 201 2010 2.8047726 2.7017615 2.6494124   -1.20364  -1.2044288
    2 "Australia" 202 2010         .         .         .          .           .
    2 "Australia" 203 2010  3.054074  2.842656  2.790689 -1.0994225  -1.1200124
    2 "Australia" 204 2011         .         .         .          .           .
    2 "Australia" 205 2011  2.800619 2.7456896  2.677183  -1.429434     -.87655
    2 "Australia" 206 2011         .         .         .          .           .
    2 "Australia" 207 2011  2.914455 3.1461716  2.774199 -1.4563322   -.8474362
    2 "Australia" 208 2012         .         .         .          .           .
    2 "Australia" 209 2012  3.088026  2.811111  2.722222  -.6837318   .20955253
    2 "Australia" 210 2012         .         .         .          .           .
    2 "Australia" 211 2012  2.938136  2.754205 2.7487195  -.6042826     .166734
    2 "Australia" 212 2013         .         .         .          .           .
    2 "Australia" 213 2013  2.706647  2.807446 2.7350006  -.6825531           .
    2 "Australia" 214 2013         .         .         .          .           .
    2 "Australia" 215 2013  2.613918  2.682024  2.739477  -.6198826           .
    2 "Australia" 216 2014         .         .         .          .           .
    2 "Australia" 217 2014 2.5800195  2.802645  2.729045  -.9707168           .
    2 "Australia" 218 2014  2.589202  2.761163  2.707383  -.9414047           .
    2 "Australia" 219 2014  2.540924  2.722103  2.701476  -.9765087           .
    2 "Australia" 220 2015 2.8432055 2.7198794  2.595569 -1.7417186           .
    2 "Australia" 221 2015 2.7443366  2.721114  2.672728 -1.7646295           .
    2 "Australia" 222 2015 2.6367245  2.674037  2.624555 -1.7286013           .
    2 "Australia" 223 2015  2.578301  2.687306  2.593712  -1.624804           .
    2 "Australia" 224 2016  2.567161  2.594888 2.4851575  .25534606           .
    2 "Australia" 225 2016  2.545651  2.651074  2.512007   .2413373           .
    2 "Australia" 226 2016  2.286601 2.5500634  2.426218   .2848978           .
    2 "Australia" 227 2016 2.1142936 2.3892326 2.4296405   .3055768           .
    2 "Australia" 228 2017 2.3016863 2.3893085   2.41294       2.57           .
    2 "Australia" 229 2017  2.200427 2.3730612  2.675015       2.57           .
    2 "Australia" 230 2017 2.2919362 2.3299131 2.6080894       2.57           .
    2 "Australia" 231 2017 2.2486498     2.368  2.618725       2.57           .
    2 "Australia" 232 2018 2.3367271  2.616056  2.560293          .           .
    2 "Australia" 233 2018 2.3031783  2.510482  2.461626          .           .
    2 "Australia" 234 2018 2.2815177 2.4767196  2.588037          .           .
    2 "Australia" 235 2018 2.1843603 2.3478806 2.5153124          .           .
    2 "Australia" 236 2019  2.352681 2.5428984  2.552917          .           .
    2 "Australia" 237 2019 2.1876905  2.409426  2.476862          .           .
    2 "Australia" 238 2019 1.9711348 2.2113662  2.444638          .           .
    2 "Australia" 239 2019 1.8865726 2.0158813  2.287677          .           .
    2 "Australia" 240 2020 2.0241566 2.2778358  2.380987          .           .
    2 "Australia" 241 2020 1.6220325 2.0643013  2.236554          .           .
    2 "Australia" 242 2020 1.5399953  1.974953 2.3672543          .           .
    2 "Australia" 243 2020 1.5316602 1.8093915  2.231043          .           .
    2 "Australia" 244 2021 1.6326138 2.1829462 2.3678145          .           .
    2 "Australia" 245 2021 1.7711756 2.0284288 2.3158772          .           .
    2 "Australia" 246 2021  1.905151 2.2323656 2.3536801          .           .
    2 "Australia" 247 2021 1.9793748 2.0864491 2.3432467          .           .
    2 "Australia" 248 2022 2.3435793 2.3391116  2.351868          .           .
    2 "Australia" 249 2022         .         .         .          .           .
    3 "Austria"   153 1998         .         .         .          .           .
    3 "Austria"   154 1998         .         .         .          .           .
    3 "Austria"   155 1998         .         .         .          .           .
    3 "Austria"   156 1999         .         .         .          .           .
    3 "Austria"   157 1999         .         .         .          .           .
    3 "Austria"   158 1999         .         .         .          .           .
    3 "Austria"   159 1999       1.3       1.7       1.8 .011603117   -.0744499
    3 "Austria"   160 2000         .         .         .          .           .
    3 "Austria"   161 2000         .         .         .          .           .
    3 "Austria"   162 2000         .         .         .          .           .
    3 "Austria"   163 2000       1.9       1.7       1.6   .6010689   .13598967
    3 "Austria"   164 2001         .         .         .          .           .
    3 "Austria"   165 2001         .         .         .          .           .
    3 "Austria"   166 2001         .         .         .          .           .
    3 "Austria"   167 2001       1.7       1.9       1.9  -.3367257  .006192684
    3 "Austria"   168 2002         .         .         .          .           .
    3 "Austria"   169 2002         .         .         .          .           .
    3 "Austria"   170 2002         .         .         .          .           .
    3 "Austria"   171 2002       1.6       1.8       1.8   .4847777   .53642154
    3 "Austria"   172 2003         .         .         .          .           .
    3 "Austria"   173 2003         .         .         .          .           .
    3 "Austria"   174 2003         .         .         .          .           .
    3 "Austria"   175 2003       1.4       1.6       1.7   1.422475    .3419254
    3 "Austria"   176 2004         .         .         .          .           .
    3 "Austria"   177 2004         .         .         .          .           .
    3 "Austria"   178 2004         .         .         .          .           .
    3 "Austria"   179 2004       1.6       1.7       1.8 -1.3438455    .4577758
    3 "Austria"   180 2005         .         .         .          .           .
    3 "Austria"   181 2005         .         .         .          .           .
    3 "Austria"   182 2005         .         .         .          .           .
    3 "Austria"   183 2005       1.9       1.7       1.7  .05326712    .3776786
    3 "Austria"   184 2006         .         .         .          .           .
    3 "Austria"   185 2006         .         .         .          .           .
    3 "Austria"   186 2006         .         .         .          .           .
    3 "Austria"   187 2006   1.78362       1.8     1.775   1.580956   -.2520535
    3 "Austria"   188 2007         .         .         .          .           .
    3 "Austria"   189 2007         .         .         .          .           .
    3 "Austria"   190 2007         .         .         .          .           .
    3 "Austria"   191 2007  1.882457      1.76      1.78   .7268379   -.2931608
    3 "Austria"   192 2008         .         .         .          .           .
    3 "Austria"   193 2008         .         .         .          .           .
    3 "Austria"   194 2008         .         .         .          .           .
    3 "Austria"   195 2008 2.3442595 2.0833333      1.98  .05907798   -.3429384
    3 "Austria"   196 2009         .         .         .          .           .
    3 "Austria"   197 2009         .         .         .          .           .
    3 "Austria"   198 2009         .         .         .          .           .
    3 "Austria"   199 2009 1.1870365       1.6      1.74 -.18959415  -.27293003
    3 "Austria"   200 2010         .         .         .          .           .
    3 "Austria"   201 2010         .         .         .          .           .
    3 "Austria"   202 2010         .         .         .          .           .
    3 "Austria"   203 2010 1.7472345       1.8       1.8 -1.1472183   -.3250285
    3 "Austria"   204 2011         .         .         .          .           .
    3 "Austria"   205 2011         .         .         .          .           .
    3 "Austria"   206 2011         .         .         .          .           .
    3 "Austria"   207 2011   2.06189     2.375 2.5666666 -1.5010376   -.2592212
    3 "Austria"   208 2012         .         .         .          .           .
    3 "Austria"   209 2012         .         .         .          .           .
    3 "Austria"   210 2012         .         .         .          .           .
    3 "Austria"   211 2012 2.0092564     1.875 1.7666667   .3213011   .53642154
    3 "Austria"   212 2013         .         .         .          .           .
    3 "Austria"   213 2013         .         .         .          .           .
    3 "Austria"   214 2013         .         .         .          .           .
    3 "Austria"   215 2013 1.8474406      1.96     1.975     .16019           .
    3 "Austria"   216 2014         .         .         .          .           .
    3 "Austria"   217 2014         .         .         .          .           .
    3 "Austria"   218 2014         .         .         .          .           .
    3 "Austria"   219 2014 1.8537726      1.88       1.9  -.5645523           .
    3 "Austria"   220 2015         .         .         .          .           .
    3 "Austria"   221 2015         .         .         .          .           .
    3 "Austria"   222 2015         .         .         .          .           .
    3 "Austria"   223 2015 1.6982102 1.8571428     1.725  -.4660447           .
    3 "Austria"   224 2016         .         .         .          .           .
    3 "Austria"   225 2016         .         .         .          .           .
    3 "Austria"   226 2016         .         .         .          .           .
    3 "Austria"   227 2016 1.6205596    1.9985 1.8666667   .8613333           .
    3 "Austria"   228 2017         .         .         .          .           .
    3 "Austria"   229 2017         .         .         .          .           .
    3 "Austria"   230 2017         .         .         .          .           .
    3 "Austria"   231 2017 1.7092755  1.684612 1.7814866       2.57           .
    3 "Austria"   232 2018         .         .         .          .           .
    3 "Austria"   233 2018  1.896055  1.908856  1.881615          .           .
    3 "Austria"   234 2018  1.956682 1.9417096  1.964647          .           .
    3 "Austria"   235 2018   2.01276 2.0234227 1.9650844          .           .
    3 "Austria"   236 2019 1.9343412 1.9199773 2.0291667          .           .
    3 "Austria"   237 2019  1.890862 1.9036027 1.9321736          .           .
    3 "Austria"   238 2019 1.8469976 1.8462026 1.9317907          .           .
    3 "Austria"   239 2019  1.683708  1.723919  1.936001          .           .
    3 "Austria"   240 2020 1.6553806 1.8660733 1.9414192          .           .
    3 "Austria"   241 2020  1.292347 1.9616535 1.9521358          .           .
    3 "Austria"   242 2020 1.1870365 1.6948752 1.9271504          .           .
    3 "Austria"   243 2020  1.330859 1.6977804 1.9599023          .           .
    3 "Austria"   244 2021 1.5913266 1.8849394 1.9623694          .           .
    3 "Austria"   245 2021 1.5541415  1.896408 1.9777607          .           .
    3 "Austria"   246 2021 1.6422247 1.8377756  2.015217          .           .
    3 "Austria"   247 2021  2.032954 1.8090304 2.0803838          .           .
    3 "Austria"   248 2022 1.8353395 2.0729463 2.0173066          .           .
    3 "Austria"   249 2022         .         .         .          .           .
    3 "Austria"   250 2022         .         .         .          .           .
    3 "Austria"   251 2022         .         .         .          .           .
    4 "Belgium"   158 1999         .         .         .          .           .
    4 "Belgium"   159 1999       1.5         2       2.1 -.12285829    .1995995
    4 "Belgium"   160 2000         .         .         .          .           .
    4 "Belgium"   161 2000         .         .         .          .           .
    4 "Belgium"   162 2000         .         .         .          .           .
    4 "Belgium"   163 2000         2         2       1.8   .8592165   .42008615
    4 "Belgium"   164 2001         .         .         .          .           .
    4 "Belgium"   165 2001         .         .         .          .           .
    4 "Belgium"   166 2001         .         .         .          .           .
    4 "Belgium"   167 2001       1.7       2.1       2.2 -.04039598   .19667363
    4 "Belgium"   168 2002         .         .         .          .           .
    4 "Belgium"   169 2002         .         .         .          .           .
    4 "Belgium"   170 2002         .         .         .          .           .
    4 "Belgium"   171 2002       1.6       1.8       1.8  .11952817   .53642154
    4 "Belgium"   172 2003         .         .         .          .           .
    4 "Belgium"   173 2003         .         .         .          .           .
    4 "Belgium"   174 2003         .         .         .          .           .
    4 "Belgium"   175 2003       1.4       1.7       1.7       2.57    .1175996
    4 "Belgium"   176 2004         .         .         .          .           .
    4 "Belgium"   177 2004         .         .         .          .           .
    4 "Belgium"   178 2004         .         .         .          .           .
    4 "Belgium"   179 2004       1.8       1.9       1.9 -1.9295728   .10651433
    4 "Belgium"   180 2005         .         .         .          .           .
    4 "Belgium"   181 2005         .         .         .          .           .
    4 "Belgium"   182 2005         .         .         .          .           .
    4 "Belgium"   183 2005       2.3       1.9       1.9   .3616496   -.3276726
    4 "Belgium"   184 2006         .         .         .          .           .
    4 "Belgium"   185 2006         .         .         .          .           .
    4 "Belgium"   186 2006         .         .         .          .           .
    4 "Belgium"   187 2006 1.8860832     1.875       1.9   1.442541   -.6417956
    end
    format %tq date


    The problem I am experiencing is the following one: when I try to estimate the regression with "newey FE5 re1 re2 re3, lag(2) force" everything works. When I try to estimate the same regression for "newey FE6 re1 re2 re3, lag(2) force" I get the error
    Code:
    no observations
    r(2000);
    The situation is the same even if I use newey2 or if I set lag(1).
    Please note that I am not currently using newey2 as it doesn't allow for factor variables, therefore I couldn't use i.country_id as FE with newey2.

    When I try to estimate the same regression with reg or with lag(0), it works without any problem.

    Thank you in advance for your time.
    Last edited by Marcus Grayer; 03 Oct 2023, 05:10.

  • #2
    ps. I add here the results I get from the estimations:

    Code:
    . newey FE5 re1 re2 re3, lag(2) force
    
    Regression with Newey–West standard errors      Number of obs     =        114
    Maximum lag = 2                                 F(  3,       110) =       2.85
                                                    Prob > F          =     0.0407
    
    ------------------------------------------------------------------------------
                 |             Newey–West
             FE5 | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             re1 |   .2507413   .3253129     0.77   0.442    -.3939526    .8954352
             re2 |   1.259591   .7797299     1.62   0.109    -.2856509    2.804833
             re3 |  -1.789742   .8396679    -2.13   0.035    -3.453767   -.1257177
           _cons |   .8986832   .4695587     1.91   0.058    -.0318719    1.829238
    ------------------------------------------------------------------------------
    
    . newey FE6 re1 re2 re3, lag(2) force
    no observations
    r(2000);
    
    . newey FE6 re1 re2 re3, lag(0) force
    
    Regression with Newey–West standard errors      Number of obs     =         78
    Maximum lag = 0                                 F(  3,        74) =       7.85
                                                    Prob > F          =     0.0001
    
    ------------------------------------------------------------------------------
                 |             Newey–West
             FE6 | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             re1 |  -.0940213   .1599267    -0.59   0.558    -.4126821    .2246395
             re2 |   .7534285   .3053735     2.47   0.016     .1449584    1.361898
             re3 |  -.9662598   .2597918    -3.72   0.000    -1.483906   -.4486133
           _cons |   .6395497   .1598903     4.00   0.000     .3209614     .958138
    ------------------------------------------------------------------------------

    Comment


    • #3
      Marcus:
      a different frequency of missing values is probably the reason of what you're experiencing:
      Code:
      . codebook FE5 FE6
      
      --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      FE5                                                                                                                                                                  (unlabeled)
      --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
                        Type: Numeric (float)
      
                       Range: [-2.5404329,2.5699999]        Units: 1.000e-09
               Unique values: 86                        Missing .: 221/335
      
                        Mean:  .362592
                   Std. dev.:  1.56744
      
                 Percentiles:      10%       25%       50%       75%       90%
                              -1.74172  -.682553   .175416   1.69357      2.57
      
      --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      FE6                                                                                                                                                                  (unlabeled)
      --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
                        Type: Numeric (float)
      
                       Range: [-1.663059,.53642154]         Units: 1.000e-09
               Unique values: 55                        Missing .: 257/335
      
                        Mean: -.122325
                   Std. dev.:  .609612
      
                 Percentiles:      10%       25%       50%       75%       90%
                               -.87655    -.4732  -.022623   .438315   .536422
      
      .
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Thank you for your reply Carlo.

        That's what I guessed as well, but I am not 100% sure.
        Do you know any possible workaround to fix this issue?

        Comment


        • #5
          Marcus:
          when it comes to missing data management, listwise deletion (that Stata applies for technical reasons) is rarely the way to go, because your resulting sample would be exclusively composed of observations with no missing values, that in turn, are usually hardly representative of the original sample (unless data are missing completely at random).
          The only sound approach is to diagnosing the missingness mechanism (missing completely at random; missing at random; missing not at random) and using the multiple imputation approach, if feasible.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Thank you Carlo.

            The missingness mechanism is not at random: more missing values in the early years with respect to the latest ones are due to a lower reported frequency in the original dataset (i.e. from 1960 till 1980 the frequency is biannual, then it moves to three obs per year and lately in the 2010's it becomes quarterly). Therefore the gaps (or missing values) have an irregular structure that depends on the period and the country.
            Do you think it would be feasible to go for a multiple imputation approach in this case?

            Comment


            • #7
              Marcus:
              with MNAR data, I would consider multiple imputation (as they were MAR) and sensitivity analysis (because they are MNAR).
              On eof my favourite paper in this topic is Multiple imputation of missing blood pressure covariates in survival analysis - van Buuren - 1999 - Statistics in Medicine - Wiley Online Library.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Thank you again Carlo for your reply. I will try to implement your suggestion.

                In the meanwhile, I tried other solutions and there is something I couldn't understand yet.
                Using the dataset mentioned above, if I keep obs when FE6 != . I get the same error when I try to estimate FE5 regression as well (no observations).
                At this point, could it be a problem with the implementation of the newey command that causes this error related to the number of lags?

                Comment


                • #9
                  Marcus:
                  yes, this is worth exploring.
                  What happens with -lag(1)-?
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Unfortunately, I get the same error: no observations. With lag(0) it works well, but of course here I am assuming White SE, instead of NW.

                    Comment


                    • #11
                      Marcus:
                      try replacing missing data with faked ones just to give it a shot and see what happens.
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #12
                        Code:
                        preserve
                        
                        sort FE6
                        
                        replace FE6 = 0 if _n > 290
                        
                        sort country_id date
                        
                        newey FE6 re1 re2, lag(2) force
                        
                        restore
                        This is the minimum sample size required to estimate the regression (i.e. 45 obs replaced). If I replace from 16 to 44 (included) values, I get instead insufficient observations error. If I replace any number less than 16 obs, I get the no observations error.

                        This is the output with 45 obs replaced. I am using just the portion of the dataset reported in the first post.

                        Code:
                        . newey FE6 re1 re2, lag(2) force
                        
                        Regression with Newey–West standard errors      Number of obs     =         92
                        Maximum lag = 2                                 F(  2,        89) =       1.17
                                                                        Prob > F          =     0.3140
                        
                        ------------------------------------------------------------------------------
                                     |             Newey–West
                                 FE6 | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
                        -------------+----------------------------------------------------------------
                                 re1 |   .0167315   .1471884     0.11   0.910    -.2757288    .3091917
                                 re2 |  -.0595312   .1654644    -0.36   0.720    -.3883055    .2692431
                               _cons |   .0433476   .1157467     0.37   0.709    -.1866386    .2733339
                        ------------------------------------------------------------------------------
                        Last edited by Marcus Grayer; 04 Oct 2023, 02:09.

                        Comment


                        • #13
                          Markus:
                          my guess is that yo have to replace all the missing values in your dataset.
                          Kind regards,
                          Carlo
                          (Stata 19.0)

                          Comment


                          • #14
                            Thank you Carlo, I'll try that.

                            I was using Newey-West SE to correct for heteroskedasticity and autocorrelation in my panel dataset. I think that I can opt for a different solution, maybe simply reg with cluster() SE at the country level or, even better, reghdfe, cluster(country_id) as I need to use time and country fixed effects for other specifications.
                            Do you think those could be a feasible solution as an alternative to NW SE?

                            Comment


                            • #15
                              Marcus:
                              if you have a N>T panel dataset with a continuous dependent variable, just go -xtreg- with -robust- or -vce(cluster panelid)- standard errors to take both heteroskedasticity and/or autocorrelation into account.
                              Kind regards,
                              Carlo
                              (Stata 19.0)

                              Comment

                              Working...
                              X