Here's one very basic solution to the first question. It might need to be generalised if you have eg panel data:
I am not sure why you call this a "seasonality problem"; using a dummy variable doesn't make much sense to me but it might be that I don't understand what you're trying to do. If you're doing a time series analysis you may wish to exclude the non-trading days, create your own time scale, and use that for your -tsset- command (see eg here).Code:. list, clean date volume 1. 24dec1990 26358 2. 25dec1990 . 3. 26dec1990 . 4. 27dec1990 51190 5. 28dec1990 79502 6. 31dec1990 60582 . drop if missing(volume) (2 observations deleted) . sort date . gen gap=date - date[_n-1] - 1 (1 missing value generated) . list, clean date volume gap 1. 24dec1990 26358 . 2. 27dec1990 51190 2 3. 28dec1990 79502 0 4. 31dec1990 60582 2 . tab gap gap | Freq. Percent Cum. ------------+----------------------------------- 0 | 1 33.33 33.33 2 | 2 66.67 100.00 ------------+----------------------------------- Total | 3 100.00





Reply With Quote
