Post
Topic
Board Meta
Re: Time Series Analysis on Distributed Merits in the forum (daily, weekly, monthly)
by
tranthidung
on 18/11/2019, 03:14:04 UTC
Intra-week merits (from 24/1/2018 to 11/11/2019)
Last two days dropped due to incomplete weeks (2019w46)

Converted dataset:
Code:
. list merit week

     +-----------------+
     | merit      week |
     |-----------------|
  1. | 30960    2018w4 |
  2. | 19979    2018w5 |
  3. | 13313    2018w6 |
  4. | 11745    2018w7 |
  5. |  8767    2018w8 |
     |-----------------|
  6. |  8833    2018w9 |
  7. |  7261   2018w10 |
  8. |  7317   2018w11 |
  9. |  6952   2018w12 |
 10. |  6744   2018w13 |
     |-----------------|
 11. |  6423   2018w14 |
 12. |  5494   2018w15 |
 13. |  4742   2018w16 |
 14. |  4612   2018w17 |
 15. |  4965   2018w18 |
     |-----------------|
 16. |  4766   2018w19 |
 17. |  4353   2018w20 |
 18. |  3864   2018w21 |
 19. |  4194   2018w22 |
 20. |  4538   2018w23 |
     |-----------------|
 21. |  3839   2018w24 |
 22. |  4929   2018w25 |
 23. |  4465   2018w26 |
 24. |  4278   2018w27 |
 25. |  4247   2018w28 |
     |-----------------|
 26. |  4167   2018w29 |
 27. |  3661   2018w30 |
 28. |  3863   2018w31 |
 29. |  4011   2018w32 |
 30. |  3631   2018w33 |
     |-----------------|
 31. |  3805   2018w34 |
 32. |  3072   2018w35 |
 33. |  3590   2018w36 |
 34. |  5644   2018w37 |
 35. |  7837   2018w38 |
     |-----------------|
 36. |  4395   2018w39 |
 37. |  4310   2018w40 |
 38. |  3816   2018w41 |
 39. |  4829   2018w42 |
 40. |  3953   2018w43 |
     |-----------------|
 41. |  3347   2018w44 |
 42. |  4525   2018w45 |
 43. |  3747   2018w46 |
 44. |  4575   2018w47 |
 45. |  3765   2018w48 |
     |-----------------|
 46. |  3571   2018w49 |
 47. |  3805   2018w50 |
 48. |  3769   2018w51 |
 49. |  3338   2018w52 |
 50. |  4803    2019w1 |
     |-----------------|
 51. |  6632    2019w2 |
 52. |  5317    2019w3 |
 53. |  4667    2019w4 |
 54. |  4491    2019w5 |
 55. |  4332    2019w6 |
     |-----------------|
 56. |  4221    2019w7 |
 57. |  4521    2019w8 |
 58. |  4638    2019w9 |
 59. |  4913   2019w10 |
 60. |  4326   2019w11 |
     |-----------------|
 61. |  4609   2019w12 |
 62. |  6130   2019w13 |
 63. |  4526   2019w14 |
 64. |  5271   2019w15 |
 65. |  4688   2019w16 |
     |-----------------|
 66. |  4448   2019w17 |
 67. |  4764   2019w18 |
 68. |  5454   2019w19 |
 69. |  5214   2019w20 |
 70. |  4580   2019w21 |
     |-----------------|
 71. |  4445   2019w22 |
 72. |  4687   2019w23 |
 73. |  5354   2019w24 |
 74. |  4726   2019w25 |
 75. |  4367   2019w26 |
     |-----------------|
 76. |  4225   2019w27 |
 77. |  4119   2019w28 |
 78. |  4277   2019w29 |
 79. |  4176   2019w30 |
 80. |  3549   2019w31 |
     |-----------------|
 81. |  3207   2019w32 |
 82. |  4236   2019w33 |
 83. |  3622   2019w34 |
 84. |  3540   2019w35 |
 85. |  3809   2019w36 |
     |-----------------|
 86. |  4043   2019w37 |
 87. |  4520   2019w38 |
 88. |  4318   2019w39 |
 89. |  4357   2019w40 |
 90. |  4565   2019w41 |
     |-----------------|
 91. |  5542   2019w42 |
 92. |  4975   2019w43 |
 93. |  4730   2019w44 |
 94. |  4735   2019w45 |
     +-----------------+

Time series plot

Basic statistics:
- 50% of observed weeks (94 weeks) have total intra-week merits above 4521, whilst the rest 50% of them have total intra-week merits below 4521. 4521 is the median - p50.
- 50% of observed weeks have total intra-week merits fluctuated in the range from 4043 to 4965 (the interquartile range, from p25 to p75, in raw statistics below).
- Min - max: 3072 - 30960.

Code:
. tabstat merit, s(n mean sd p50 p25 p75 min max) format(%9.1f)

    variable |         N      mean        sd       p50       p25       p75       min       max
-------------+--------------------------------------------------------------------------------
       merit |      94.0    5290.2    3476.3    4520.5    4043.0    4965.0    3072.0   30960.0
----------------------------------------------------------------------------------------------

Potential outliers:
Code:
. di 4965-4043
922

. di 922*1.5
1383

. di 4965+1383
6348

. di 4043-1383
2660
It means that potential outliers are weeks that have intra-week merits beyond 2660 or 6348.
How many weeks are potential outliers?
Code:
. count if (merit >= 6348 | merit < 2660) & merit != .
  13
13 weeks are outliers, in total.
List of those thirteen weeks:
Code:
. list merit week if merit >= 6348 | merit <= 2660

     +-----------------+
     | merit      week |
     |-----------------|
  1. | 30960    2018w4 |
  2. | 19979    2018w5 |
  3. | 13313    2018w6 |
  4. | 11745    2018w7 |
  5. |  8767    2018w8 |
     |-----------------|
  6. |  8833    2018w9 |
  7. |  7261   2018w10 |
  8. |  7317   2018w11 |
  9. |  6952   2018w12 |
 10. |  6744   2018w13 |
     |-----------------|
 11. |  6423   2018w14 |
 35. |  7837   2018w38 |
 51. |  6632    2019w2 |
     +-----------------+
Most of them occured in the year 2018, and there is only one outlier week occured in 2019, in 2019w2 at 6632.  Grin