Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with time-trend analysis

    I have a database of the volume of a certain type of test across time. I want to show how the trend in the volumes of this test have changed at a certain point - around the start of the COIVD pandemic.

    Besides showing this in a graph, I was wondering if there is a statistical test i can run to show how the trend changes around that time.

    Thinking of using regression with a knot around the timepoint - but I was wondering if there is something better to use.

    Thank you in advance good people

    Sample data below

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int date float study
    21454 1
    21525 1
    21335 1
    21424 1
    21222 1
    21405 1
    21265 1
    21283 1
    21515 1
    21500 1
    21399 1
    21328 1
    21500 1
    21458 1
    21234 1
    21535 1
    21682 1
    21899 1
    21911 1
    21682 1
    21885 1
    21710 1
    21871 1
    21895 1
    21879 1
    21774 1
    21860 1
    21801 1
    21895 1
    21818 1
    21868 1
    22174 1
    22055 1
    22050 1
    22117 1
    22141 1
    22273 1
    22070 1
    22105 1
    22105 1
    22259 1
    22196 1
    22236 1
    22001 1
    22075 1
    21976 1
    21935 1
    22271 1
    22091 1
    22250 1
    22127 1
    22251 1
    21985 1
    21942 1
    21966 1
    22494 1
    22501 1
    22578 1
    22512 1
    22445 1
    22568 1
    22305 1
    22561 1
    22371 1
    22421 1
    22589 1
    22399 1
    22460 1
    22476 1
    22314 1
    22592 1
    22404 1
    22434 1
    22582 1
    22561 1
    22390 1
    22307 1
    22462 1
    22637 1
    22419 1
    22452 1
    22453 1
    22587 1
    22368 1
    22385 1
    22579 1
    22606 1
    22419 1
    22307 1
    22351 1
    22413 1
    22295 1
    22481 1
    22319 1
    22490 1
    22725 1
    22726 1
    22768 1
    22652 1
    22880 1
    end
    format %td date

  • #2
    Ahmed:
    if your -timevar- were continuous, I would search for a possible turning point:
    Code:
    regress <depvar> c.timevar##c.timevar <otherindvars>
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X