Dear all
I have a panel data set. The data are daily and do not include weekends. In each day, a number of firms provide information x. This number of firms can change from one day to the other.
My question is basic. I want to calculate the number of firms that have the variable x for a window of two days. I used the following code:
The day of the week variable in my dataset is "dayofweek" created by Stata, and as I have no weekends, it ranges from 1 to 5.
My problem is that when using the code above, it calculates the number of firms that provide variable x for a two-day window as I wanted except for Fridays. On Fridays, it counts the number for this day only!
How can I adjust the code so that it calculates the number for two days also for Fridays, i.e., Friday+Monday instead of only Friday?
I have a panel data set. The data are daily and do not include weekends. In each day, a number of firms provide information x. This number of firms can change from one day to the other.
My question is basic. I want to calculate the number of firms that have the variable x for a window of two days. I used the following code:
Code:
rangestat (count) number_of_providers=x, int(date 0 1)
My problem is that when using the code above, it calculates the number of firms that provide variable x for a two-day window as I wanted except for Fridays. On Fridays, it counts the number for this day only!
How can I adjust the code so that it calculates the number for two days also for Fridays, i.e., Friday+Monday instead of only Friday?
Comment