Announcement

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

  • Iterations in logistic regression

    Is there any work on what affects the number of iterations required to achieve convergence in logistic regression -- number of X variables, distribution of X variables, correlation among X variables, strength of relationship between X and Y?

    I apologize for posting this non-Stata question here, but I've turned up nothing in Google Scholar and this tends to be a pretty knowledgeable crowd.

  • #2
    Maybe you find some information here:

    https://www.stata-press.com/books/ma...imation-stata/
    Best wishes

    Stata 18.0 MP | ORCID | Google Scholar

    Comment


    • #3
      That seems to be highly dependent on the finer details of the exact algorithm used, including the starting values. So I doubt there is a general answer. You could do some simulations, e.g.:

      Code:
      clear all
      set seed 123456
      
      program sim
          syntax, n(integer) k(integer)
          drop _all
          qui set obs `n'
          gen double xb = 0
          forvalues i = 1/`k' {
              gen x`i' = rnormal()
              local xs `"`xs' x`i'"'
              qui replace xb = xb + x`i'
          }
          gen y = runiform() < invlogit(xb)
          qui logit y `xs'
      end
      
      
      simulate ic= e(ic), reps(100): sim, n(1000) k(3)
      tab ic
      simulate ic= e(ic), reps(100): sim, n(1000) k(30)    
      tab ic
      Above I prelimanarily looked ath the number of explanatory variables. Other scenarios I would look at are
      • the correlation between the explanatory variables (use drawnorm to create the explanatory variables with correlation)
      • the variance of the dependent variable (add a non-zero constant to the population parameters. If the explanatory variables are all centered at 0, then the larger the constant (in absolute terms) the less variance)
      • in the example above the size of the effects are quite large: a standard deviation change in each of the xs is associated with a exp(1)=2.7 times increase in the odds. You can change the effect size when computing xb
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment

      Working...
      X