Announcement

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

  • Mixed logit - bysort prefix leads to "convergence not achieved"

    Hi everyone,

    I am trying to calculate the WTP for different categories of independent variables. I am getting coefficients when I run a mixed logit regression, i.e., cmmixlogit choice t_time, casevars(hinc age_group gender marital employment educ) random(t_cost). But most of my case specific variables are having categories, such as income_groupI, income_groupII. I want to estimate t_time and t_cost coefficients for each of the categories of the case specific variables. I am using by hinc, sort : cmmixlogit choice t_cost, casevars(i.hinc) random(t_time). But it is not converging.

    Can anyone please help me in this regard understand the problem and the way out?

    Thanks for any help.
    Last edited by Sujit Chauhan; 16 Dec 2022, 09:58.

  • #2
    Sujt:
    welcome to this forum.
    The usual fix is to start it all over again, adding one predictor at a time and see when Stata starts complaining.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      #1 raises the questions of

      1. How many parameters are you trying to estimate?

      2. How many observations are in each group?

      and above all the comment

      3. You are asking for a separate fit for each distinct value of hinc. So, if I understand correctly, hinc is no longer a variable for each group; it is a constant. I doubt you will get useful results even if you try to tweak what you are asking for.

      Comment


      • #4
        Originally posted by Nick Cox View Post
        #1 raises the questions of

        1. How many parameters are you trying to estimate?

        2. How many observations are in each group?

        and above all the comment

        3. You are asking for a separate fit for each distinct value of hinc. So, if I understand correctly, hinc is no longer a variable for each group; it is a constant. I doubt you will get useful results even if you try to tweak what you are asking for.

        Thanks for your reply.
        1. I have three alternative specific variables: t_time, t_cost, and length; I have two case-specific variable: hinc and age; choice is my dependent variable.
        2. Total number of observations is 228.
        3. I am looking for an estimate of different groups of hinc for different alternatives, i.e., I have six groups of hinc and four alternatives. My purpose is to use this estimate to derive WTP.

        Comment


        • #5
          I don't see that you get my point #3. The effect of the bysort prefix is to call for a separate model fit for each distinct value of hinc. You can't ask for that and also declare hinc to be a predictor in your model But I can't be clear that this is your main problem.

          Comment


          • #6
            Originally posted by Nick Cox View Post
            I don't see that you get my point #3. The effect of the bysort prefix is to call for a separate model fit for each distinct value of hinc. You can't ask for that and also declare hinc to be a predictor in your model But I can't be clear that this is your main problem.
            Thanks, I understood your point.

            Comment

            Working...
            X