What is the right way to use rangestat command in STATA to count for observations?
The data set CRSPmonthly contains monthly data (January 1927-Dec 2023) on firms that are in the database of the Center for Research in Security Prices (CRSP). It includes stocks that are listed on NYSE, AMEX, or Nasdaq. Returns are returns of common shares (with CRSP share code of 10 or 11). Returns are adjusted for dividends and delistings. Prices are closing prices, and returns are from close to close. (Same as in the original research article, just a longer time horizon.)
Provide a table where you start with the number of observations in the data set and the number of different stocks (based on PERMNO). Show how these figures decrease when you add each of the following filters:
(a) price at t − 13 not missing
(b) ret at t − 2 not missing
(c) market equity at t − 1 not missing
(d) out of the returns from t − 12 to t − 2 at least 8 monthly returns are non-missing.
Hint: The Stata command rangestat might come in handy for your calculations.