Got a bit stuck with this error. I need to construct 25 portfolios rebalanced every year with all available stocks in a given year (their number is time-varying). My dataset looks like:
And the error came out after the xtile() command:
Any idea how to solve the problem?
Thanks
S
Code:
Contains data obs: 656,760 vars: 11 size: 27,583,920 ---------------------------------------------------------------------------------------------------------------------------------------------------- storage display value variable name type format label variable label ---------------------------------------------------------------------------------------------------------------------------------------------------- datem float %tm id int %9.0g datey float %ty totvol float %9.0g monthlyvol float %9.0g milliq float %9.0g montRet float %9.0g mktret float %9.0g avilliq float %9.0g lnavilliq float %9.0g L_datey float %9.0g ---------------------------------------------------------------------------------------------------------------------------------------------------- Sorted by: datem id
Code:
egen portfolio = xtile(milliq), nq(25) by(id L_datey)
Thanks
S
Comment