I am working with panel data and I would like to kindly ask you for some guidance. The problem may seem trivial to some of you, but I have to admit I do not know how to deal with my problem.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double crsp_fundno long caldt float totalreturn 2706 15279 .024748646 2706 16282 -.013114043 2706 16314 .01105325 2706 16344 .013855805 2706 16373 .01221272 2706 16405 .02567463 2706 16436 .023424506 2706 16467 -.011213606 2706 16495 .00991609 2706 16526 -.011934737 2706 16555 -.002844098 2706 16587 .022079043 2706 16617 .007660258 2706 16646 .015898954 2706 16679 .006798665 2706 16709 .004056035 2706 16740 -.013472764 2706 16770 .021835493 2706 16800 .012771065 2706 16832 .02111781 2706 16860 -.0013869605 2706 16891 .00344977 2706 16919 .008940833 2706 16952 -.02251356 2706 16982 .0006903863 2706 17013 .0041847653 2706 17044 .017356306 2706 17073 .013650396 2706 17105 .020194326 2706 17135 .014516724 2706 17164 .005006196 2706 17197 .007528771 2706 17225 .0013551157 2706 17255 .005412986 2706 17286 .02227978 2706 17317 .013191413 2706 17346 -.007165887 2706 17378 -.008541029 2706 17409 .008599109 2706 17437 .02756282 2706 17470 .0204282 2706 17500 -.015645668 2706 17531 -.004752705 2706 17562 -.02759434 2706 17591 -.013820929 2706 17622 -.01256211 2706 17652 .031387217 2706 17682 .005068702 2706 17713 -.04542773 2706 17744 -.014363908 2706 17773 -.001528342 2706 17805 -.07752702 2706 17836 -.11563985 2706 17864 -.03855668 2706 17897 .04511837 2706 17927 -.0402251 2706 17955 -.0566357 2706 17987 .04560557 2706 18017 .06875563 2706 18046 .05882353 2706 18078 .004115226 2706 18109 .05840164 2706 18140 .027105516 2706 18170 .033930253 2706 18200 -.006381039 2706 18231 .03119266 2706 18262 .009373898 2706 18291 -.014362657 2706 18319 .013661202 2706 18352 .03504043 2706 18382 .012152778 2706 18410 -.04631218 2706 18443 -.01528777 2706 18473 .04840183 2706 18505 -.014808362 2708 15279 .02570281 2708 16405 .04043605 2708 16436 .03043185 2708 16467 -.01996008 2708 16495 .016972166 2708 16526 -.015353805 2708 16555 -.01016949 2708 16587 .028767124 2708 16617 .007989348 2708 16646 .027741084 2708 16679 .003213368 2708 16709 .010890455 2708 16740 -.015842838 2708 16770 .03090792 2708 16800 .014739787 2708 16832 .029126214 2708 16860 -.003144654 2708 16891 .010094637 2708 16919 .01436602 2708 16952 -.032635465 2708 16982 .0006365372 2708 17013 -.0006361323 2708 17044 .01909612 2708 17073 .01623985 2708 17105 .02704364 end format %td caldt
I am using 60 month estimation window to get alpha for funds in my sample, in the later stage. The data was provided on consecutive monthly basis. Normally in a ideal circumstances I would use
bys crsp_fundno: gen obs=_N
drop if obs<60
drop obs,
and then run the rangestat with interval of 60. But the problem is that in the meantime, I had to drop observations when a fund for example was too volatile or too small. Thus, there is a possibility that I will not have 60 consecutive months for my estimation window for a fund (for example, in the 60 month window for a fund with 65 monthly observations, if any (except first or last 5) month is missing). This is slightly (or more) too much for my current STATA level. This is why I would like to kindly ask you which command should I use to check how many time such situation happens in my sample that although a fund has 60 months but those are not consecutive, and what command should I use with the rangestat (reg) command the way it would not calculate anything when the window consist of 60 months that are not consecutive?
Thank you very much!
Best,
RafaĆ
0 Response to Consecutive observations by mofd
Post a Comment