Hi Statalist,
I have a simple question, but can not solve it yet. I have tried many times, but yet no solution.
In Panel data, I would like to generate lag for dailyMR and lag for liquidity. I try use the code below, but the result appear was "not sorted" r5.
Does anyone have an idea what is wrong with my data. From data below, it seems all sorted according to company and caldate.
Thank you in advanced.
I have a simple question, but can not solve it yet. I have tried many times, but yet no solution.
In Panel data, I would like to generate lag for dailyMR and lag for liquidity. I try use the code below, but the result appear was "not sorted" r5.
Does anyone have an idea what is wrong with my data. From data below, it seems all sorted according to company and caldate.
Code:
gen lag_liquidty = L.liquidity not sorted r(5);
Code:
gen lag_dailyMR = L.dailyMR not sorted r(5);
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float idc str21 company float(caldate dailyMR return turnover liquidity) 1 "ALUAR" 16803 . . . . 1 "ALUAR" 16804 .57453316 -1.0000079 .00026832195 -.0008290283 1 "ALUAR" 16805 6.143557 1.4962867 .0001801904 -.0011104317 1 "ALUAR" 16806 -.2811049 .4938291 -.00005071409 -.0005513455 1 "ALUAR" 16807 1.493126 1.951283 -.00014974715 -.003205513 1 "ALUAR" 16810 1.2772804 .4819319 .000061128725 -.000435019 1 "ALUAR" 16811 2.2725384e-07 3.667978e-06 -.0002303494 -1.0946313e-08 1 "ALUAR" 16812 1.130413 3.667978e-06 -.00015540613 -8.14151e-09 1 "ALUAR" 16813 -.9894335 3.667978e-06 -.00013939025 -8.3142435e-09 1 "ALUAR" 16814 -1.4835738 -.9661874 -.00020480275 -.0044442695 1 "ALUAR" 16817 2.43612 -.9756147 -.0001404652 -.0029261224 1 "ALUAR" 16818 4.256966 1.9418105 .00008240703 -.0021166024 1 "ALUAR" 16819 1.8582594 2.3754122 6.999413e-06 -.0031803616 1 "ALUAR" 16820 1.3807563 -5.372813e-06 .00008234708 -5.601704e-09 1 "ALUAR" 16821 -.4033334 -2.375414 -.0001295466 -.006384655 1 "ALUAR" 16824 -.29552194 3.667978e-06 -.000137045 -1.1232173e-08 1 "ALUAR" 16825 .3269679 -.9661874 -.00009242458 -.0022897667 1 "ALUAR" 16826 -.011237455 -.9756147 -.00014652606 -.003788391 1 "ALUAR" 16827 .8484781 1.4598818 -.00018611016 -.011132359 1 "ALUAR" 16828 2.494687 1.438877 -.000028606446 -.0026522144 end format %td caldate
Comment