I have a question about how to identify the weekday of the high and low points in time series analysis.
My data looks like this, where odate is the date and daily average is the variable of interest. I generated the weekday of the data by use of the dow command in stata.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(odate daily_average dow) 21833 558.8615 5 21834 602.16187 6 21835 599.1369 0 21836 586.83997 1 21837 487.384 2 21840 588.78766 5 21841 583.47736 6 21842 598.8483 0 21843 569.3498 1 21847 546.3105 5 21848 546.90594 6 21849 592.6006 0 21853 702.3023 4 21854 570.108 5 21855 587.7522 6 21856 579.67017 0 21857 576.75354 1 21858 504.4952 2 21859 564.3304 3 21860 722.5038 4 21861 541.64734 5 21862 538.60876 6 21864 630.0263 1 21865 496.88385 2 21866 659.5681 3 21867 718.9317 4 21868 597.2248 5 21869 617.5574 6 21870 608.1977 0 21871 573.3346 1 21872 513.1751 2 21873 579.5194 3 21874 731.8616 4 21875 591.5007 5 21876 585.56494 6 21877 600.34674 0 21878 571.5742 1 21879 478.3791 2 21880 570.5222 3 21881 719.6547 4 21882 573.55774 5 21883 559.4268 6 21884 571.9596 0 21885 609.8727 1 21886 514.05 2 21887 573.0786 3 21888 727.6231 4 21889 568.8781 5 21890 598.8592 6 21891 604.44745 0 21892 589.0873 1 21893 484.4622 2 21894 593.1388 3 21895 750.2917 4 21896 597.18036 5 21897 594.0722 6 21898 612.2352 0 21901 593.78156 3 21902 731.9205 4 21903 587.6961 5 21904 585.5294 6 21905 592.0468 0 21906 597.9922 1 21907 457.2679 2 21908 586.17267 3 21909 754.5541 4 21910 602.9098 5 21911 594.4632 6 21912 596.5747 0 21913 606.11554 1 21914 540.07556 2 21915 611.2679 3 21916 716.9801 4 21917 571.1439 5 21918 558.21387 6 21919 588.6963 0 21920 577.4242 1 21921 496.9474 2 21922 558.11566 3 21923 750.2371 4 21924 562.8652 5 21925 594.6396 6 21926 604.78296 0 21927 596.4515 1 21929 606.9549 3 21930 738.0359 4 21931 600.69617 5 21932 570.9493 6 21933 561.29755 0 21934 554.81696 1 21935 493.2901 2 21936 518.47144 3 21937 639.7033 4 21938 559.89703 5 21939 595.8712 6 21942 605.671 2 21943 614.989 3 21944 704.0444 4 21945 512.14 5 21946 415.8226 6 end format %tdCCYY-NN-DD odate
Code:
twoway (tsline daily_average)
I want to know the days for the high and low points in the picture, say whether it is Thursday, Sunday etc. I wonder if anyone knows how to do this Stata. Currently what I can do is to mark the weekend on the graph but that's not what we want exactly because it turns out that the weekend does not correspond to the high and low points most of the time. Therefore, I wonder if you have any idea about how to do this in Stata.
Thank you so much!
0 Response to Identify weekdays for the high and low points in time series analysis
Post a Comment