I am using the asreg command to calculate betas using one year of daily data, but I want the year to have at least 150 observations. (I am using CRSP daily data)
To that end I applied the following :
gen day = day(date)
bys PERMNO : asreg exc_ret MktRF, window( day 252 ) min(151)
It works, however, I get values even for the very first observations of my sample.
Does anyone have any idea why that happens?
Thank you for taking the time to read my question.
P.S: In case it is relevant, here is a preview of my data (before I added the MktRF and before I created the exc_ret) using dataex.
. dataex
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double PERMNO long date double(SHRCD EXCHCD) str8 CUSIP double(PRC RET SHROUT) 10001 12057 11 3 "36720410" 14.5 .0357142873108387 1080 10001 12058 11 3 "36720410" -14.25 -.017241379246115685 1080 10001 12059 11 3 "36720410" -14.25 0 1080 10001 12060 11 3 "36720410" 14.5 .017543859779834747 1080 10001 12061 11 3 "36720410" 14.5 0 1080 10001 12064 11 3 "36720410" 14.5 0 1080 10001 12065 11 3 "36720410" -14.25 -.017241379246115685 1080 10001 12066 11 3 "36720410" 13.75 -.035087719559669495 1080 10001 12067 11 3 "36720410" 13.75 0 1080 10001 12068 11 3 "36720410" -14 .0181818176060915 1080 10001 12071 11 3 "36720410" -14 0 1080 10001 12072 11 3 "36720410" 13.75 -.01785714365541935 1080 10001 12073 11 3 "36720410" 14.25 .036363635212183 1080 10001 12074 11 3 "36720410" 14.25 0 1080 10001 12075 11 3 "36720410" 13.75 -.035087719559669495 1080 10001 12078 11 3 "36720410" -14 .0181818176060915 1080 10001 12079 11 3 "36720410" -14 0 1080 10001 12080 11 3 "36720410" 13.75 -.01785714365541935 1080 10001 12081 11 3 "36720410" -14 .0181818176060915 1080 10001 12082 11 3 "36720410" -14 0 1080 10001 12085 11 3 "36720410" 13.75 -.01785714365541935 1080 10001 12086 11 3 "36720410" 13.75 0 1080 10001 12087 11 3 "36720410" -14 .0181818176060915 1080 10001 12088 11 3 "36720410" -14 0 1080 10001 12089 11 3 "36720410" -14 0 1080 10001 12092 11 3 "36720410" 13.75 -.01785714365541935 1080 10001 12093 11 3 "36720410" 14.25 .036363635212183 1080 10001 12094 11 3 "36720410" 13.75 -.035087719559669495 1080 10001 12095 11 3 "36720410" -14 .0181818176060915 1080 10001 12096 11 3 "36720410" 14.25 .01785714365541935 1080 10001 12100 11 3 "36720410" 14 -.017543859779834747 1080 10001 12101 11 3 "36720410" -14 0 1080 10001 12102 11 3 "36720410" 14.25 .01785714365541935 1080 10001 12103 11 3 "36720410" -14 -.017543859779834747 1080 10001 12106 11 3 "36720410" -14 0 1080 10001 12107 11 3 "36720410" -14 0 1080 10001 12108 11 3 "36720410" 14.25 .01785714365541935 1080 10001 12109 11 3 "36720410" -14 -.017543859779834747 1080 10001 12110 11 3 "36720410" 14.25 .01785714365541935 1080 10001 12113 11 3 "36720410" 14.5 .017543859779834747 1080 10001 12114 11 3 "36720410" -14.125 -.0258620698004961 1080 10001 12115 11 3 "36720410" -14.125 0 1080 10001 12116 11 3 "36720410" -14.125 0 1080 10001 12117 11 3 "36720410" -14.125 0 1080 10001 12120 11 3 "36720410" 13.75 -.015398230403661728 1080 10001 12121 11 3 "36720410" 13.75 0 1080 10001 12122 11 3 "36720410" 14.25 .036363635212183 1080 10001 12123 11 3 "36720410" 14 -.017543859779834747 1080 10001 12124 11 3 "36720410" 14.25 .01785714365541935 1080 10001 12127 11 3 "36720410" 14.125 -.008771929889917374 1080 10001 12128 11 3 "36720410" 14.25 .008849557489156723 1080 10001 12129 11 3 "36720410" -14.125 -.008771929889917374 1080 10001 12130 11 3 "36720410" 13.75 -.02654867246747017 1080 10001 12131 11 3 "36720410" -14.125 .027272727340459824 1080 10001 12134 11 3 "36720410" 14.5 .02654867246747017 1080 10001 12135 11 3 "36720410" 13.75 -.0517241396009922 1080 10001 12136 11 3 "36720410" 13.75 0 1080 10001 12137 11 3 "36720410" 13.75 0 1080 10001 12138 11 3 "36720410" -14.125 .027272727340459824 1080 10001 12141 11 3 "36720410" 13.75 -.02654867246747017 1080 10001 12142 11 3 "36720410" -14.125 .027272727340459824 1080 10001 12143 11 3 "36720410" 14.25 .008849557489156723 1075 10001 12144 11 3 "36720410" -14.125 -.008771929889917374 1075 10001 12145 11 3 "36720410" -14.125 0 1075 10001 12148 11 3 "36720410" 14.5 .02654867246747017 1075 10001 12149 11 3 "36720410" -14.125 -.0258620698004961 1075 10001 12150 11 3 "36720410" -14.125 0 1075 10001 12151 11 3 "36720410" 13.75 -.02654867246747017 1075 10001 12155 11 3 "36720410" -14.125 .027272727340459824 1075 10001 12156 11 3 "36720410" 14.5 .02654867246747017 1075 10001 12157 11 3 "36720410" 14.5 0 1075 10001 12158 11 3 "36720410" 14.5 0 1075 10001 12159 11 3 "36720410" 14.75 .017241379246115685 1075 10001 12162 11 3 "36720410" 14.75 0 1075 10001 12163 11 3 "36720410" 14.75 0 1075 10001 12164 11 3 "36720410" 14.75 0 1075 10001 12165 11 3 "36720410" 14.5 -.016949152573943138 1075 10001 12166 11 3 "36720410" 14.75 .017241379246115685 1075 10001 12169 11 3 "36720410" 14.75 0 1075 10001 12170 11 3 "36720410" 14.75 0 1075 10001 12171 11 3 "36720410" -15.25 .033898305147886276 1075 10001 12172 11 3 "36720410" 15.75 .032786883413791656 1075 10001 12173 11 3 "36720410" -15.25 -.0317460335791111 1075 10001 12176 11 3 "36720410" -15.25 0 1075 10001 12177 11 3 "36720410" 15.5 .016393441706895828 1075 10001 12178 11 3 "36720410" 15.75 .016129031777381897 1075 10001 12179 11 3 "36720410" -15.25 -.0317460335791111 1075 10001 12180 11 3 "36720410" 15.75 .032786883413791656 1075 10001 12183 11 3 "36720410" -15.25 -.0317460335791111 1075 10001 12184 11 3 "36720410" -15.25 0 1075 10001 12185 11 3 "36720410" 15.5 .016393441706895828 1075 10001 12186 11 3 "36720410" 15.5 0 1075 10001 12187 11 3 "36720410" 14.75 -.04838709533214569 1075 10001 12190 11 3 "36720410" 15 .016949152573943138 1075 10001 12191 11 3 "36720410" 15.5 .03333333507180214 1075 10001 12192 11 3 "36720410" 15.25 -.016129031777381897 1075 10001 12193 11 3 "36720410" 15.5 .016393441706895828 1075 10001 12194 11 3 "36720410" 15.5 0 1075 10001 12197 11 3 "36720410" -15.125 -.024193547666072845 1075 10001 12198 11 3 "36720410" -15.125 0 1075 end format %td date
0 Response to Why does the asreg command give me values for the first observations of my sample even thought I specified a min?
Post a Comment