Announcement

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

  • Interrupted Time series (ITS) - Convergence not achieved

    Dear STATA members,


    I am running an ITS on a panel data using the start date of a testing program (as my interruption date). When I run xtitsa command using just my dependent variable, I get the error of "convergence not achieved".

    Can anyone help me with that, please?

    Best,
    Anseh


    Code:
    gen date1= date(date, "YMD")
    gen surv_date= date(surv_policy_go_live_date, "YMD")
    
    gen weeks_from_surv_start= round((date1 - surv_date)/14)
    
    egen pannel_var= group(related_organization poc_test_type reason_for_poc_test test_type account_role__c test_result)
    
    gen weeks_from_surv_start_pos = weeks_from_surv_start + 21
    
    xtset pannel_var weeks_from_surv_start
    
    xtitsa positivity_rate if weeks_from_surv_start < 12 & weeks_from_surv_start > -8, single trperiod(0) posttrend figure replace
    
    
    
    
    
    . xtset pannel_var weeks_from_surv_start
    
    Panel variable: pannel_var (unbalanced)
     Time variable: weeks_from_surv_start, -21 to 22, but with gaps
             Delta: 1 unit
    
    .
    end of do-file
    
    
    . xtitsa positivity_rate if weeks_from_surv_start < 12 & weeks_from_surv_start > -8, single trperiod(0) posttrend figure replace
    
    
    
    Panel variable: pannel_var (unbalanced)
     Time variable: weeks_from_surv_start, -21 to 22, but with gaps
             Delta: 1 unit
    
    (resetting alpha to -0.0582)
    Iteration 1: tolerance = .00329983
    (resetting alpha to -0.0582)
    Iteration 2: tolerance = 0
    
    GEE population-averaged model                       Number of obs    =  33,245
    Group variable: pannel_var                          Number of groups =   8,657
    Family: Gaussian                                    Obs per group:  
    Link:   Identity                                                 min =       1
    Correlation: exchangeable                                        avg =     3.8
                                                                     max =      18
                                                        Wald chi2(3)     = 3699.33
    Scale parameter = .0011869                          Prob > chi2      =  0.0000
    
    ------------------------------------------------------------------------------
    _positivit~e | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
              _t |  -.0005946   .0000525   -11.33   0.000    -.0006974   -.0004918
             _x0 |  -.0169303   .0007456   -22.71   0.000    -.0183917   -.0154689
           _x_t0 |   .0038683   .0000667    58.01   0.000     .0037377     .003999
           _cons |   .0357383   .0006089    58.70   0.000     .0345449    .0369316
    ------------------------------------------------------------------------------
    convergence not achieved
    r(430);
    
    end of do-file
    
    r(430);
    Last edited by Anseh Danesharasteh; 21 Apr 2023, 09:07.

  • #2
    No idea. Likely has to do with the unbalanced panel- your data has a panel with one observation. Why? And, 8657 panels at that. Are you sure ITS is the right design here?

    EDIT: Also, your method uses maximum likelihood. So, maybe due to the issues with the panel structure (maybe it needs a balanced panel), ti cannot estimate the log-likelihood

    Comment


    • #3
      Thank you for your response, Jared.

      So the data includes testing information from late August 2021 to late June 2022 in a biweekly period. Not all test centers have information in all dates. I think that is the reason of unbalanced panel.

      I am interested to see the changes (in the slope, if any) after the intervention and that is why I choose ITSA. I tried eventdd but was not that much informative.

      For the panel with one observation, I have no idea! Any suggestions on how can I check that?

      And any suggestions on how I can fix this problem?

      Comment

      Working...
      X