Hi all,

I previously ran the following negative binomial regression on unbalanced panel data (in Stata/IC 15.1), and subsequently re-analyzed the data by time period.

Code:
xtnbreg sumevent hindufinrev relelitefin1 festivalfin lang1finrev marketbasketfin1 faminefin elections malelitfin1 urban20kfin1 directrule provmovsum provvsbaseline log_popfin
I am attempting to run a recursive xtnbreg to determine if my periodization choices are robust.

Following code discussed in this thread (https://www.statalist.org/forums/for...g-probit-model), I tried to estimate the model using rolling.

Code:
rolling _b _se, recursive window(36) clear: xtnbreg sumevent hindufinrev relelitefin1 festivalfin lang1finrev marketbasketfin1 faminefin elections malelitfin1 urban20kfin1 directrule provmovsum provvsbaseline log_popfin
However, it just runs for hours, slowly printing red x's.

Other discussions suggest using rangestat for rolling regressions on unbalanced panel data (https://www.statalist.org/forums/for...ced-panel-data), but this isn't an option for me, since rangestat is primarily built for OLS.

Any advice would be much appreciated!


Here is my data:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte sumevent float(hindufinrev relelitefin1 festivalfin lang1finrev marketbasketfin1) byte faminefin float(elections malelitfin1 urban20kfin1 directrule provmovsum provvsbaseline log_popfin)
1 -5.24 -6.188182 0 -4.06  -.1517857 0 0 .47 0 1 0          0 15.400948
0 -5.24 -6.188182 0 -4.06 -.15121727 0 0 .47 0 1 1  -.9090909 15.400948
0 -5.24 -6.188182 2 -4.06  -.1506488 0 0 .47 0 1 1  -.9090909 15.400948
0 -5.24 -6.188182 0 -4.06 -.15008035 0 0 .47 0 1 1  -.8181818 15.400948
0 -5.24 -6.188182 0 -4.06  -.1495119 0 0 .47 0 1 1  -.6363636 15.400948
0 -5.24 -6.188182 0 -4.06 -.14894345 0 0 .47 0 1 1  -.6363636 15.400948
0 -5.24 -6.188182 0 -4.06   -.148375 0 0 .47 0 1 1  -.5454545 15.400948
0 -5.24 -6.188182 0 -4.06 -.14780656 0 0 .47 0 1 1 -.27272725 15.400948
0 -5.24 -6.188182 0 -4.06 -.14723809 0 0 .47 0 1 1  -.1818182 15.400948
0 -5.24 -6.188182 0 -4.06 -.14666964 0 0 .47 0 1 1  .09090912 15.400948
0 -5.24 -6.188182 1 -4.06 -.14610119 0 0 .47 0 1 1  .27272725 15.400948
0 -5.24 -6.188182 1 -4.06 -.14553274 0 0 .47 0 1 1   .3636364 15.400948
0 -5.24 -6.188182 0 -4.06  -.1449643 0 0 .47 0 1 1   .4545455 15.400948
0 -5.24 -6.188182 1 -4.06 -.14439584 0 0 .47 0 1 0  1.4545455 15.400948
0 -5.24 -6.188182 1 -4.06 -.14382738 0 0 .47 0 1 0  1.4545455 15.400948
0 -5.24 -6.188182 0 -4.06 -.14325893 0 0 .47 0 1 0  1.7272727 15.400948
0 -5.24 -6.188182 0 -4.06 -.14269048 0 0 .47 0 1 0  1.6363636 15.400948
0 -5.24 -6.188182 0 -4.06 -.14212203 0 0 .47 0 1 0  1.6363636 15.400948
0 -5.24 -6.188182 0 -4.06 -.14155358 0 0 .47 0 1 0  1.5454545 15.400948
0 -5.24 -6.188182 0 -4.06 -.14098512 0 0 .47 0 1 0  1.5454545 15.400948
0 -5.24 -6.188182 0 -4.06 -.14041667 0 0 .47 0 1 0  1.4545455 15.400948
0 -5.24 -6.188182 1 -4.06 -.13984822 0 0 .47 0 1 0  1.2727273 15.400948
0 -5.24 -6.188182 1 -4.06 -.13927977 0 0 .47 0 1 0  1.0909091 15.400948
0 -5.24 -6.188182 1 -4.06 -.13871132 0 0 .47 0 1 0          1 15.400948
0 -5.24 -6.188182 0 -4.06 -.13814285 0 0 .47 0 1 0   .9090909 15.400948
0 -5.24 -6.188182 1 -4.06  -.1375744 0 0 .47 0 1 0   .9090909 15.400948
0 -5.24 -6.188182 1 -4.06 -.13700595 0 0 .47 0 1 0   .9090909 15.400948
0 -5.24 -6.188182 0 -4.06  -.1364375 0 0 .47 0 1 0   .6363636 15.400948
0 -5.24 -6.188182 0 -4.06 -.13586906 0 0 .47 0 1 0  .54545456 15.400948
0 -5.24 -6.188182 0 -4.06 -.13530059 0 0 .47 0 1 0  .54545456 15.400948
0 -5.24 -6.188182 0 -4.06 -.13473214 0 0 .47 0 1 0  .54545456 15.400948
0 -5.24 -6.188182 0 -4.06  -.1341637 0 0 .47 0 1 0  .54545456 15.400948
0 -5.24 -6.188182 0 -4.06 -.13359524 0 0 .47 0 1 0  .54545456 15.400948
0 -5.24 -6.188182 1 -4.06  -.1330268 0 0 .47 0 1 0  .54545456 15.400948
0 -5.24 -6.188182 1 -4.06 -.13245833 0 0 .47 0 1 0   .9090909 15.400948
0 -5.24 -6.188182 0 -4.06 -.13188988 0 0 .47 0 1 0   .9090909 15.400948
0 -5.24 -6.188182 1 -4.06 -.13132143 0 0 .47 0 1 0  1.0909091 15.400948
0 -5.24 -6.188182 0 -4.06 -.13075298 0 0 .47 0 1 0          1 15.400948
0 -5.24 -6.188182 1 -4.06 -.13018453 0 0 .47 0 1 0  1.0909091 15.400948
0 -5.24 -6.188182 0 -4.06 -.12961607 0 0 .47 0 1 0  1.2727273 15.400948
0 -5.24 -6.188182 0 -4.06 -.12904762 0 0 .47 0 1 0  1.2727273 15.400948
0 -5.24 -6.188182 0 -4.06 -.12847917 0 0 .47 0 1 0  1.2727273 15.400948
0 -5.24 -6.188182 0 -4.06 -.12791072 0 0 .47 0 1 0  1.2727273 15.400948
0 -5.24 -6.188182 0 -4.06 -.12734227 0 0 .47 0 1 0          1 15.400948
0 -5.24 -6.188182 0 -4.06  -.1267738 0 0 .47 0 1 0  1.0909091 15.400948
0 -5.24 -6.188182 0 -4.06 -.12620535 0 0 .47 0 1 0          1 15.400948
0 -5.24 -6.188182 2 -4.06  -.1256369 0 0 .47 0 1 0   .6363636 15.400948
0 -5.24 -6.188182 0 -4.06 -.12506846 0 0 .47 0 1 0   .6363636 15.400948
0 -5.24 -6.188182 1 -4.06     -.1245 0 0 .47 0 1 0   .4545455 15.400948
0 -5.24 -6.188182 0 -4.06 -.12393155 0 0 .47 0 1 0  .54545456 15.400948
0 -5.24 -6.188182 1 -4.06  -.1233631 0 0 .47 0 1 0   .4545455 15.400948
0 -5.24 -6.188182 0 -4.06 -.12279464 0 0 .47 0 1 0  .27272728 15.400948
0 -5.24 -6.188182 0 -4.06  -.1222262 0 0 .47 0 1 0  .27272728 15.400948
0 -5.24 -6.188182 0 -4.06 -.12165774 0 0 .47 0 1 0   .3636364 15.400948
0 -5.24 -6.188182 0 -4.06 -.12108929 0 0 .47 0 1 0   .3636364 15.400948
0 -5.24 -6.188182 0 -4.06 -.12052084 0 0 .47 0 1 0   .4545455 15.400948
0 -5.24 -6.188182 0 -4.06 -.11995238 0 0 .47 0 1 0   .4545455 15.400948
0 -5.24 -6.188182 2 -4.06 -.11938393 0 0 .47 0 1 0   .4545455 15.400948
0 -5.24 -6.188182 0 -4.06 -.11881548 0 0 .47 0 1 0   .4545455 15.400948
0 -5.24 -6.188182 0 -4.06 -.11824702 0 0 .47 0 1 0   .4545455 15.400948

end