Dear Stata community,
I have stock returns file from CRSP where the date format follows business calendar (for e.g. 12Apr2019). For each stock (id), I want to compute the number of trading days, over non-missing observations, in last three years. Since number of trading days might differ over years, and also for different stocks, when new firms enter and/or some existing firms drop, the computations will differ for each id over the same period. Thus, I want to specify a 3-year range for each id over the trading days during the last three years (13Apr2016 to 12Apr2019).
I am not sure how to specify the rolling window for each id’s non-missing obs in the interval part of rangestat syntax:
rangestat (count) price, interval(date -xx 0) by(id)
I have been trying to find some guidance available online but I have not been able to find clear guidance since most intervals are illustrated within a few trading days, such as 3, 5, and 90) window.
Any guidance will be sincerely appreciated!
Thanks for reading.
Kind regards,
Manish
Related Posts with Seeking guidance for the interval specification of rangestat command
GOF of Logit Model: Pearson's chi2, Hosmer and Lemeshow's testHi everyone, I am using a logit model (attached below) to investigate the impact of minority status…
Variables created after shp2dtaHi everyone, After I run 'shp2dta' to turn shape files into Stata data files, I notice I have some …
Questions about GMMHello, I'm a beginner in economitrics and statistics and I'm working on system GMM, sometimes I foun…
Seasonality in panel dataHi, I am working with panel data observations. Now, I have a question that could be sound silly. My …
GOF of Logit Model: Pearson's chi2, Hosmer and Lemeshow's testHi everyone, I am using a logit model (attached below) to investigate the impact of minority status…
Subscribe to:
Post Comments (Atom)
0 Response to Seeking guidance for the interval specification of rangestat command
Post a Comment