thank you! You are right that there is a mistake in the proc sort. Should be proc sort by gvkey datadate. Yes I'd like the minimum # of obs in a regression of 8 observations and I'd like to use all the observations prior to the certain 'gvkey datadate'. For example, if for one gvkey datadate, I have 9 quarter of data prior to this date, I'd like to put them all in the regression. And if I have 10, I'd like to use all of them PRIOR to this date. The only requirement is I 'd like to have at least 8 observations. How can I do this?
... View more