Announcement

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

  • asclogit can't convergence

    Hi everyone,

    I've recently encountered a problem with a logit model that can't converge. My research topic is about understanding whether a company's characteristics influence people's choices among different alternatives.

    I have four alternatives, each under two conditions: with and without a companion. This setup results in eight dummy variables (4 alternatives * 2 conditions). I included seven of these dummy variables in my model. However, the model fails to converge even after I tried increasing the maximum number of iterations and changing the base dummy variable. The log likelihood keeps repeating when it reaches a certain value.

    Below are my data and the command I used. Can someone give me some advice on this? Thanks!

    (alternative1-4 stands for terminal, cargo offsite, neither sequently)
    gen accompany_terminal=accompany*const1
    gen accompany_cargo=accompany*const2
    gen accompany_offsite=accompany*const3
    gen accompany_neither=accompany*const4

    gen Dnoaccompany_terminal=0
    replace Dnoaccompany_terminal=1 if accompany_terminal==0 &alt==1
    gen Dnoaccompany_cargo=0
    replace Dnoaccompany_cargo=1 if accompany_cargo==0 &alt==2
    gen Dnoaccompany_offsite=0
    replace Dnoaccompany_offsite=1 if accompany_offsite==0 &alt==3
    gen Dnoaccompany_neither=0
    replace Dnoaccompany_neither=1 if accompany_neither==0 &alt==4

    gen Dwaccompany_terminal=0
    replace Dwaccompany_terminal=1 if accompany_terminal>0 &alt==1
    gen Dwaccompany_cargo=0
    replace Dwaccompany_cargo=1 if accompany_cargo>0 &alt==2
    gen Dwaccompany_offsite=0
    replace Dwaccompany_offsite=1 if accompany_offsite>0 &alt==3
    gen Dwaccompany_neither=0
    replace Dwaccompany_neither=1 if accompany_neither>0 &alt==4

    asclogit AW dailydiscountedcharge totaltime Ddaily Dhourlim indoormix contact spaceprob contactspace Dnoaccompany_terminal Dwaccompany_terminal Dnoaccompany_cargo Dwaccompany_cargo Dnoaccompany_offsite Dwaccompany_offsite Dnoaccompany_neither ,case(scenario) alternatives(alt) vce (cluster num) nolog

    (I remove some column of variable since the Message Board can't fit in )
    number ver circum scenario alt accompany days AW const1 const2 const3 const4 accompany_terminal accompany_cargo accompany_offsite accompany_neither Dnoaccompany_terminal Dnoaccompany_cargo Dnoaccompany_offsite Dnoaccompany_neither Dwaccompany_terminal Dwaccompany_cargo Dwaccompany_offsite Dwaccompany_neither
    1 1 1 1 5 5 0 1 0 0 0 5 0 0 0 0 0 0 0 1 0 0 0
    1 1 1 2 5 5 1 0 1 0 0 0 5 0 0 0 0 0 0 0 1 0 0
    1 1 1 3 5 5 0 0 0 1 0 0 0 5 0 0 0 0 0 0 0 1 0
    1 1 1 4 5 5 0 0 0 0 1 0 0 0 5 0 0 0 0 0 0 0 1
    1 2 2 1 5 3 0 1 0 0 0 5 0 0 0 0 0 0 0 1 0 0 0
    1 2 2 2 5 3 1 0 1 0 0 0 5 0 0 0 0 0 0 0 1 0 0
    1 2 2 3 5 3 0 0 0 1 0 0 0 5 0 0 0 0 0 0 0 1 0
    1 2 2 4 5 3 0 0 0 0 1 0 0 0 5 0 0 0 0 0 0 0 1
    1 3 3 1 0 7 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
    1 3 3 2 0 7 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
    1 3 3 3 0 7 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0
    1 3 3 4 0 7 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0
    2 1 4 1 3 6 1 1 0 0 0 3 0 0 0 0 0 0 0 1 0 0 0
    2 1 4 2 3 6 0 0 1 0 0 0 3 0 0 0 0 0 0 0 1 0 0
    2 1 4 3 3 6 0 0 0 1 0 0 0 3 0 0 0 0 0 0 0 1 0
    2 1 4 4 3 6 0 0 0 0 1 0 0 0 3 0 0 0 0 0 0 0 1
    2 2 5 1 3 7 0 1 0 0 0 3 0 0 0 0 0 0 0 1 0 0 0
    2 2 5 2 3 7 0 0 1 0 0 0 3 0 0 0 0 0 0 0 1 0 0
    2 2 5 3 3 7 1 0 0 1 0 0 0 3 0 0 0 0 0 0 0 1 0
    2 2 5 4 3 7 0 0 0 0 1 0 0 0 3 0 0 0 0 0 0 0 1
    2 3 6 1 0 11 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
    2 3 6 2 0 11 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0
    2 3 6 3 0 11 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0
    2 3 6 4 0 11 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0



    Click image for larger version

Name:	2024-07-04 17_20_34-712 757 978 - AnyDesk.jpg
Views:	1
Size:	75.7 KB
ID:	1757808



  • #2
    Hung:
    the usual recipe is starting with a more parsimonious model, add one more predictor at a time and see when Stata starts to complain about convergence.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Hung:
      the usual recipe is starting with a more parsimonious model, add one more predictor at a time and see when Stata starts to complain about convergence.
      Dear Carlo,

      Yes, that's true.
      I already tried the model without the variable which are related with "accompany"
      And it does has the result.
      Probably I should try variable "accompany" ,if it can converge.
      Then breakdown it into more detailed alternative specific variable.
      Thanks for reply.
      (I use STATA 15.1)

      Best Regards,

      Comment


      • #4
        Answer my own questions,
        Since the dummy variable are highly associate with ASCs.
        I just dropped some of it. And the model did converges.

        Comment

        Working...
        X