Dear Statalists,
I am having a trouble with running rolling regressions by -rangestat-. After running the code:
The command window shows an error
Can I ask, there is any professional who knows where is wrong? Many thanks in advance!!
This is my partial dataset: (P1 is the first-sorted quartile portfolio with 1-4 and double_P2 is the second-sorted quartile portfolio with 1-4)
I am having a trouble with running rolling regressions by -rangestat-. After running the code:
Code:
rangestat (reg) exret_m mktrf smb hml, interval(quarter -2 0) by(permno P1 double_P2)
no result for all obs: reg exret_m mktrf smb hml
This is my partial dataset: (P1 is the first-sorted quartile portfolio with 1-4 and double_P2 is the second-sorted quartile portfolio with 1-4)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double permno float(ym quarter exret_m) double(mktrf smb hml) float(P1 double_P2) 10001 623 207 .05183491 .0074 -.0070999999999999995 .0174 1 2 10001 626 208 .04875993 .0311 -.0060999999999999995 .0087 1 2 10001 629 209 -.027325016 .038900000000000004 .0077 .0044 1 2 10001 632 210 .000401006 .0273 .005 .0152 1 2 10001 635 211 -.015331147 .0118 .0147 .0355 1 2 10001 638 212 .03068413 .0403 .0079 -.0026 1 2 10001 641 213 .006323002 -.012 .012199999999999999 -.0019 1 2 10001 644 214 .004411765 .0377 .0294 -.0118 1 2 10001 650 216 .0795941 .0043 -.0189 .0509 1 2 10001 653 217 .009056263 .026099999999999998 .030600000000000002 -.0074 1 2 10001 656 218 .05097524 -.0197 -.0382 -.012199999999999999 1 2 10001 659 219 -.03782605 -.0006 .0254 .0207 1 2 10001 662 220 -.00049508293 -.011200000000000002 .0305 -.0045000000000000005 1 2 10001 665 221 .03000002 -.015300000000000001 .0281 -.008100000000000001 1 2 10001 668 222 .0033669735 -.0308 -.0264 .0053 1 2 10001 671 223 -.13225102 -.0217 -.0281 -.025699999999999997 1 2 10001 611 203 .05219088 .0682 .006999999999999999 .0381 1 3 10001 614 204 .072304375 .0045000000000000005 .026000000000000002 -.0155 1 3 10001 617 205 .008260886 -.0175 -.0018 -.0031 1 3 10001 620 206 .005009129 -.0759 -.0348 -.0146 1 3 10001 647 215 -.05885783 .0281 -.005 -.003 1 4 10001 608 202 .0764596 .09539999999999999 .0392 -.031200000000000002 . . 10002 512 170 -.04059999 -.1035 .025699999999999997 .0131 1 3 10002 515 171 .05739056 -.0576 0 .0225 1 3 10002 518 172 .09560374 .0109 .0089 -.0209 1 3 10002 521 173 .04015751 .014199999999999999 .0167 .0066 1 3 10002 524 174 -.05424933 -.0124 .0079 .0002 1 3 10002 527 175 .02264745 .0429 -.0301 .0242 1 3 10002 530 176 -.024722686 -.0132 .0175 .0021 1 3 10002 554 184 .006272808 .0146 .0355 .0060999999999999995 1 3 10002 572 190 -.013052215 .0322 -.0229 -.018600000000000002 1 4 10002 533 177 .03015792 .018600000000000002 .0226 .0138 2 1 10002 536 178 .05173647 .016 .0304 -.0025 2 1 10002 539 179 .15990242 .034300000000000004 .0012 -.0006 2 1 10002 542 180 -.015181378 -.0197 -.013999999999999999 .015600000000000001 2 1 10002 545 181 -.007863974 .005699999999999999 .0262 .0262 2 1 10002 548 182 -.11130605 .0049 -.0058 .0077 2 1 10002 551 183 -.0007222957 -.0025 -.0046 .0044 2 1 10002 557 185 .08456084 -.0034999999999999996 -.0034999999999999996 .0087 2 1 10002 560 186 .05126724 .0184 -.0137 .0005 2 1 10002 563 187 .05547961 .0087 -.011000000000000001 .0316 2 1 10002 566 188 -.04485884 .0068000000000000005 -.0006 -.0022 2 1 10002 569 189 .05039117 -.0196 .0077 -.0113 2 1 10002 587 195 .19310904 .0174 .0359 -.0024 2 1 10002 590 196 .04160328 .0895 -.0009 .0352 2 1 10002 593 197 -.2830736 .0043 .026099999999999998 -.0271 2 1 10002 596 198 -.04042261 .0408 .0245 .0092 2 1 10002 599 199 .03600105 .0275 .0611 .0001 2 1 10002 602 200 .07054011 .06309999999999999 .014199999999999999 .021 2 1 10002 605 201 -.1648855 -.0556 -.0197 -.045 2 1 10002 608 202 -.016229017 .09539999999999999 .0392 -.031200000000000002 2 1 10002 611 203 .06364505 .0682 .006999999999999999 .0381 2 1 10002 614 204 -.068281844 .0045000000000000005 .026000000000000002 -.0155 2 1 10002 617 205 .05327864 -.0175 -.0018 -.0031 2 1 10002 620 206 0 -.0759 -.0348 -.0146 2 1 10002 623 207 -.283237 .0074 -.0070999999999999995 .0174 2 1 10002 626 208 .1153847 .0311 -.0060999999999999995 .0087 2 1 10002 629 209 .017006787 .038900000000000004 .0077 .0044 2 1 10002 632 210 .02748618 .0273 .005 .0152 2 1 10002 635 211 .010845805 .0118 .0147 .0355 2 1 10002 578 192 -.01170908 -.009300000000000001 .009399999999999999 -.0015 2 2 10002 581 193 -.333708 -.08439999999999999 .0127 -.024300000000000002 2 2 10002 584 194 .5684053 -.0924 -.0113 .0633 2 2 10002 575 191 -.020370636 -.0087 .002 -.0052 2 3 10002 509 169 .008576544 -.0721 .0426 .0013 . . 10003 380 126 -.04807826 -.0159 .0163 -.01 1 2 10003 383 127 -.2730308 .1084 -.0223 -.0404 1 2 10003 386 128 .13296364 -.026600000000000002 -.0104 .0365 1 2 10003 389 129 -.1762769 -.023399999999999997 -.030899999999999997 .0341 1 2 10003 395 131 .4062909 .015300000000000001 .016399999999999998 .0252 1 2 10003 398 132 -.03107143 .023 .0023 .012199999999999999 1 2 10003 401 133 -.02173077 .0031 -.003 .026099999999999998 1 2 10003 404 134 .033114288 -.0012 .0311 -.0045000000000000005 1 2 10003 407 135 -.07048182 .0165 .012199999999999999 .005699999999999999 1 2 10003 410 136 .0473 -.0478 -.0098 .0131 1 2 10003 413 137 -.1031 -.030299999999999997 -.004699999999999999 .0168 1 2 10003 422 140 -.0903143 .0219 -.006999999999999999 -.010700000000000001 1 2 10003 428 142 .070700005 .0335 -.021099999999999997 -.0077 1 2 10003 392 130 .29151765 .011899999999999999 .005600000000000001 -.0021 1 3 10003 416 138 -.0989381 -.0231 .0282 -.0191 1 3 10003 419 139 -.1044 .0086 .0003 .0053 1 3 10003 425 141 .51910955 .027200000000000002 .029300000000000003 -.0227 1 3 10003 377 125 -.3145448 -.049400000000000006 .0006 .012199999999999999 1 4 10003 317 105 .05577561 .0103 -.0091 .013999999999999999 2 4 10003 320 106 -.06219231 -.086 .022799999999999997 .0318 2 4 10003 323 107 -.05428272 -.0327 .0007000000000000001 .0033 2 4 10003 326 108 -.0047 .016399999999999998 .0037 .016399999999999998 2 4 10003 335 111 -.03838276 .0681 .0013 -.0446 2 4 10003 338 112 .02191579 -.0227 .061500000000000006 .0075 2 4 10003 341 113 .12261678 .0479 .0212 -.011000000000000001 2 4 10003 344 114 -.11463374 .033 -.0125 -.0068000000000000005 2 4 10003 347 115 .007033334 .0149 .0195 -.015600000000000001 2 4 10003 350 116 .06682941 .015700000000000002 .0073 .004699999999999999 2 4 10003 353 117 -.1966425 -.013500000000000002 -.0102 .0219 2 4 10003 356 118 -.07692254 -.0076 .0028000000000000004 -.0134 2 4 10003 359 119 -.26696956 .0116 -.0241 .0028000000000000004 2 4 10003 362 120 -.1858872 .0183 .0152 -.028999999999999998 2 4 10003 365 121 -.18487144 -.0109 .0143 -.0194 2 4 10003 368 122 -.37334695 -.061200000000000004 -.036699999999999997 .0073 2 4 10003 371 123 -.23676923 .0246 .008100000000000001 -.015600000000000001 2 4 end format %tm ym format %tq quarter
Comment