Many thanks again for the support. The commands are working now. I have a few questions here.
1) What is the following command exactly doing?
rangestat (sum) deal, by(cusip) interval(Year -3 -1)
2) Does the following drop observations which have a deal sum which is missing or one? If so, shouldn't it be also higher than one? Additionally, are only the observations with role = a dropped or also the ones with role = t?
by obs_no (deal_sum), sort: drop if inrange(deal_sum[_N], 1, .)
3) Regarding the previous command. It is very important that I only want to drop observations which are not a deal (deal = 0) and NOT observations which are a deal (deal = 1). I do not see any specification here that only observations are dropped which are not a deal.
4) What is incorrect with the command I suggested. I'm just asking for future use.
1) What is the following command exactly doing?
rangestat (sum) deal, by(cusip) interval(Year -3 -1)
2) Does the following drop observations which have a deal sum which is missing or one? If so, shouldn't it be also higher than one? Additionally, are only the observations with role = a dropped or also the ones with role = t?
by obs_no (deal_sum), sort: drop if inrange(deal_sum[_N], 1, .)
3) Regarding the previous command. It is very important that I only want to drop observations which are not a deal (deal = 0) and NOT observations which are a deal (deal = 1). I do not see any specification here that only observations are dropped which are not a deal.
4) What is incorrect with the command I suggested. I'm just asking for future use.
Comment