Announcement

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

  • lclogit2 and bayesmixedlogit

    Dear Statalist,

    I am using "lclogit2" and "bayesmixedlogit" to analyze data from a choice experiment using the following model:

    Code:
    1. lclogit2: lclogit2 choice, rand(per tax sup audit fee type_obl type_vol contr_assoc contr_conglo contr_muni) id(pid) group(gid) ncl(4) 2. bayesmixedlogit: bayesmixedlogit choice, rand(per tax sup audit fee type_obl type_vol contr_assoc contr_conglo contr_muni) group(gid) id(pid) draws(2000) burn(1000) thin(5) arater(.4) saving(bml_draws) replace
    And I had the following error messages :
    1. lclogit2: . lclogit2 choice, rand(per tax sup audit fee type_obl type_vol contr_assoc contr_con > glo contr_muni) id(pid) group(gid) ncl(4) Iteration 0: log likelihood = -1436.1431 weights must be the same for all observations in a group r(407); 2. bayesmixedlogit: . bayesmixedlogit choice, rand(per tax sup audit fee type_obl type_vol contr_assoc co > ntr_conglo contr_muni) group(gid) id(pid) draws(2000) burn(1000) thin(5) arater(.4) > saving(bml_draws) replace initialize_rand(): 3499 amcmc_init() not found <istmt>: - function returned error r(3499); Thanks for your help!

  • #2
    Jae-hyung Park: Re: -lclogit2-, it's difficult for me to tell where the problem is on the basis of the command line alone. Could you provide an example data file (it doesn't have to be large) that can be used to replicate the error message? Re: -bayesmixedlogit-, it seems that you haven't installed other community-contributed packages that the command depends on. You may find the following information from -help bayesmixedlogit- useful:

    bayesmixedlogit requires that the package of Mata functions amcmc() be installed and also requires installation of Ben Jann's moremata set of extended Mata functions.

    Comment


    • #3
      Dear Professor Hong il You,

      I am glad to receive a message from the developer of the lclogit2/lclogitml2 package.
      And I have attached an excel file.

      The variables are as follows;

      independent variables
      - alt : alternatives * There are 6 questions. Each of them has 3 alternatives.
      - ec_sales(energy consumption per sales), indus(industry), size : basic characteristics of the respondents(companies)
      - type, per(period), contr(controlled by), tax, sup, audit(these are all incentives), fee : attributes
      - the rest of variables : dummy variables

      dependent variable
      - choice : 1 or 0

      And I want to ask an additional question.
      Can I apply "membership" option to my previous code?

      Thank you in advance.
      Attached Files

      Comment


      • #4
        Jae-hyung Park: Glad to be of help. I'd like to suggest the following.

        (1) Similarly as Arne Risa Hole's -mixlogit- and -gmnl-, -lclogit2- expects you to assign different values of the -group()- variable to each pair of an individual and a choice scenario. For example, choice scenario 1 for individual 1 should take a different -group()- value from choice scenario 1 for individual 2. You can create a new group ID variable that satisfies this requirement by typing:
        Code:
        egen newgid = group(pid gid)
        and use -newgid- as your -group()-variable.

        (2) Your model specification suffers from perfect mulicollinearity. Please note that your -type_obl- and -type_vol- variables add up to one, and -contr_assoc-, -contr_conglo- and -contr_muni- also add up to one. As usual, when you have K categories, you can only include K-1 categorical dummies to avoid the dummy variable trap. I suggest that you exclude one categorical dummy from each case. For example, you may estimate the following model specification:
        Code:
         lclogit2 choice, rand(per tax sup audit fee type_obl contr_assoc contr_conglo) id(pid) group(newgid) ncl(4)
        (3) You can use -membership()- option to let the class membership probabilities to vary with individual-specific characteristics, such as -size- in your data set.
        Last edited by Hong Il Yoo; 08 Sep 2023, 14:47.

        Comment


        • #5
          Dear Professor Hong il You,

          Thank you for your kind and prompt response.
          I learned what are lclogit2 and bayesmiedlogit in more detail with your help.
          And I will try it by installing some more packages and modifying the command.

          Thank you again!

          Comment

          Working...
          X