Announcement

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

  • eaalogit to account for attribute non-attendance

    Hello

    I am trying to account for attribute non-attendance for my choice experiment via the eaalogit command by Hole, Arne, (2016), EAALOGIT: Stata module to estimate endogenous attribute attendance models, https://EconPapers.repec.org/RePEc:boc:bocode:s457903.

    I am using the following code:
    Code:
    matrix b0=e(b) #after I estimated my latent class model via lclogit
    eaalogit chosen fpr fsec ftert mnopr mpr msec mtert fnopr_nch fpr_nch fsec_nch ftert_nch mnopr_nch mpr_nch msec_nch mtert_nch fnopr_nch2 fpr_nch2 fsec_nch2 ftert_nch2 mnopr_nch2 mpr_nch2 msec_nch2 mtert_nch2, group(choicecard) id(respondent) keaa(23) eaaspec(x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23) from(b0)
    I tried this on three versions of Stata. However I get the following error messages on the two versions:
    Version 14
    initial vector: extra parameter choice1:fpr found
    specify skip option if necessary
    r(111);
    Version 15
    Some variables are collinear - if this is intended use the coll option. However I can't find how to use this command online.
    Version 16
    convergence not achieved
    r(430);

    Anyone who has an idea how to solve this?

    Thank you very much in advance!

    Kind regards

    Eva

  • #2
    Version 14
    initial vector: extra parameter choice1:fpr found
    specify skip option if necessary
    r(111);
    This is usually solved with

    Code:
    from(b0, skip)

    Comment


    • #3
      I find it odd that you are getting these different error messages in different versions of Stata. Are you sure that your code is identical and that you are using the same version of eaalogit in all three versions?

      You don't show the code used to generate the starting values, but I suggest that you use the default starting values instead.

      Consider simplifying the model. You are trying to estimate 23 ANA parameters which is asking a lot from your data. For example it is possible to assign the same ANA parameter to several variables (see the help file for an example), which is particularly useful if the variables are dummies representing different values of the same categorical attribute in the choice experiment.

      Comment


      • #4
        Andrew Musau and Arne Risa Hole, thank you for your answers!

        I tried it for a reduced model as follows:
        Code:
        eaalogit chosen fpr fsec ftert mnopr mpr msec mtert, group(choicecard) id(respondent) keaa(8) eaaspec(x1 x2 x3 x4 x5 x6 x7 x8)  from(b0, skip)
        However, then I get this error message:
        Code:
                       eaa_gf0():  3200  conformability error
              mopt__calluser_v():     -  function returned error
              opt__v0_calluser():     -  function returned error
            deriv__call1user_v():     -  function returned error
         _deriv__compute_value():     -  function returned error
                        _deriv():     -  function returned error
               opt__eval_nr_v0():     -  function returned error
                     opt__eval():     -  function returned error
        opt__looputil_iter0_common():     -  function returned error
        opt__looputil_iter0_nr():     -  function returned error
                  opt__loop_nr():     -  function returned error
                    _moptimize():     -  function returned error
                   Mopt_maxmin():     -  function returned error
                         <istmt>:     -  function returned error
        r(3200);

        Comment


        • #5
          It is difficult to diagnose problems like this without seeing any of your data. Note that the group variable has to be a unique identifier for each choice occasion, so each choice occasion needs a different value (both within and across individuals).

          As suggested try using the default starting values (drop "from(b0, skip)" from the syntax).

          Your model specification is inconsistent - you have 7 explanatory variables and 8 ANA parameters.

          A general recommendation based on reading this and some of your other recent posts is to start with a simple model and build up complexity gradually. Make sure you can get sensible results using e.g. asclogit first and then move on to more advanced models in incremental steps. Good luck.
          Last edited by Arne Risa Hole; 29 Feb 2020, 03:34.

          Comment


          • #6
            Arne Risa Hole thank you very much for your reply! My model above was indeed misspecified.

            I performed a choice experiment with 12 cards per respondent each consisting of 2 alternatives. The model that I use (based on the AICc and BIC criteria and some assumptions to obtain a realistic model) includes 8 schooling components (fnopr, fpr, fsec, ftert, mnopr, mpr, msec and mtert) which are all interacted with the number of children (nch) and the number of children of power 2 (nch2). One of the main effects of the schooling components (fnopr) is omitted to allow to estimate my model since my model involves a mixture model.These are the first rows of my data:
            Code:
             
            respondent choice card time alternative chosen fnopr fpr fsec ftert mnopr mpr msec mtert nch nch2 nch3 nch4 nch5 nch6 nch7 nch8 fnopr_nch fpr_nch fsec_nch ftert_nch mnopr_nch mpr_nch msec_nch mtert_nch fnopr_nch2 fpr_nch2 fsec_nch2 ftert_nch2 mnopr_nch2 mpr_nch2 msec_nch2 mtert_nch2
            1 1 1 1 1 0 0 0 0 0 0 1 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
            1 1 1 2 0 0.333333 0.666667 0 0 0 0 0 0 3 9 27 81 243 729 2187 6561 1 2 0 0 0 0 0 0 3 6 0 0 0 0 0 0
            1 2 2 1 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0
            1 2 2 2 1 0 0 0.25 0 0 0 0.25 0.5 4 16 64 256 1024 4096 16384 65536 0 0 1 0 0 0 1 2 0 0 4 0 0 0 4 8
            1 3 3 1 0 0 0 0 0 0.333333 0 0.666667 0 3 9 27 81 243 729 2187 6561 0 0 0 0 1 0 2 0 0 0 0 0 3 0 6 0
            1 3 3 2 1 0 0 0 0 0 0.666667 0.333333 0 3 9 27 81 243 729 2187 6561 0 0 0 0 0 2 1 0 0 0 0 0 0 6 3 0
            1 4 4 1 0 0 0 0 0 0.333333 0 0 0.666667 3 9 27 81 243 729 2187 6561 0 0 0 0 1 0 0 2 0 0 0 0 3 0 0 6
            1 4 4 2 1 0 0 0 0.6 0.4 0 0 0 10 100 1000 10000 100000 1000000 10000000 1E+08 0 0 0 6 4 0 0 0 0 0 0 60 40 0 0 0
            1 5 5 1 0 0.333333 0.333333 0.333333 0 0 0 0 0 3 9 27 81 243 729 2187 6561 1 1 1 0 0 0 0 0 3 3 3 0 0 0 0 0
            1 5 5 2 1 0.25 0 0.25 0 0 0 0 0.5 4 16 64 256 1024 4096 16384 65536 1 0 1 0 0 0 0 2 4 0 4 0 0 0 0 8
            1 6 6 1 1 0 0 0 0 0 0 0.5 0.5 2 4 8 16 32 64 128 256 0 0 0 0 0 0 1 1 0 0 0 0 0 0 2 2
            1 6 6 2 0 0 0 0 0.75 0.25 0 0 0 8 64 512 4096 32768 262144 2097152 16777216 0 0 0 6 2 0 0 0 0 0 0 48 16 0 0 0
            1 7 7 1 1 0 1 0 0 0 0 0 0 3 9 27 81 243 729 2187 6561 0 3 0 0 0 0 0 0 0 9 0 0 0 0 0 0
            1 7 7 2 0 0.2 0.2 0 0 0.2 0 0 0.4 10 100 1000 10000 100000 1000000 10000000 1E+08 2 2 0 0 2 0 0 4 20 20 0 0 20 0 0 40
            1 8 8 1 0 0.2 0 0.4 0 0.2 0 0.2 0 5 25 125 625 3125 15625 78125 390625 1 0 2 0 1 0 1 0 5 0 10 0 5 0 5 0
            1 8 8 2 1 0.333333 0 0.333333 0 0 0 0 0.333333 12 144 1728 20736 248832 2985984 35831808 4.3E+08 4 0 4 0 0 0 0 4 48 0 48 0 0 0 0 48
            1 9 9 1 1 0 0.4 0 0.4 0.2 0 0 0 5 25 125 625 3125 15625 78125 390625 0 2 0 2 1 0 0 0 0 10 0 10 5 0 0 0
            1 9 9 2 0 0.333333 0 0.333333 0 0 0 0.333333 0 12 144 1728 20736 248832 2985984 35831808 4.3E+08 4 0 4 0 0 0 4 0 48 0 48 0 0 0 48 0
            1 10 10 1 1 0 0 0.4 0.4 0 0 0.2 0 5 25 125 625 3125 15625 78125 390625 0 0 2 2 0 0 1 0 0 0 10 10 0 0 5 0
            1 10 10 2 0 0.4 0.4 0 0 0 0.2 0 0 5 25 125 625 3125 15625 78125 390625 2 2 0 0 0 1 0 0 10 10 0 0 0 5 0 0
            1 11 11 1 1 0 0.5 0.5 0 0 0 0 0 2 4 8 16 32 64 128 256 0 1 1 0 0 0 0 0 0 2 2 0 0 0 0 0
            1 11 11 2 0 0 0.4 0 0 0 0 0.6 0 10 100 1000 10000 100000 1000000 10000000 1E+08 0 4 0 0 0 0 6 0 0 40 0 0 0 0 60 0
            1 12 12 1 0 0.333333 0.333333 0 0 0 0 0 0.333333 9 81 729 6561 59049 531441 4782969 43046721 3 3 0 0 0 0 0 3 27 27 0 0 0 0 0 27
            1 12 12 2 1 0.166667 0 0 0.333333 0.166667 0 0 0.333333 12 144 1728 20736 248832 2985984 35831808 4.3E+08 2 0 0 4 2 0 0 4 24 0 0 48 24 0 0 48
            2 13 1 1 1 0 0 0 0 0 0 1 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
            2 13 1 2 0 0.333333 0.666667 0 0 0 0 0 0 3 9 27 81 243 729 2187 6561 1 2 0 0 0 0 0 0 3 6 0 0 0 0 0 0
            2 14 2 1 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0
            2 14 2 2 1 0 0 0.25 0 0 0 0.25 0.5 4 16 64 256 1024 4096 16384 65536 0 0 1 0 0 0 1 2 0 0 4 0 0 0 4 8
            I was already able to analyse a conditional logit, mixed logit and latent class model on my data. However, I also wanted to check for attribute non-attendance. As you suggested, I first tried to do this for only some parameters of my model as follow:
            Code:
            eaalogit chosen fpr fsec ftert mnopr mpr msec mtert, group(choicecard) id(respondent) keaa(7) eaaspec(x1 x2 x3 x4 x5 x6 x7)
            This works, although after more than 600 iterations and running my command for 12h, I did not get an output yet, but after most of the iterations Stata shows that the iteration is 'not concave'.

            The code for my full model (where I assume that if respondents ignored one of the main effects of the schooling components, they also would ignore the interaction term) should have to be:
            Code:
            eaalogit chosen fpr fsec ftert mnopr mpr msec mtert fnopr_nch fpr_nch fsec_nch ftert_nch mnopr_nch mpr_nch msec_nch mtert_nch fnopr_nch2 fpr_nch2 fsec_nch2 ftert_nch2 mnopr_nch2 mpr_nch2 msec_nch2 mtert_nch2, group(choicecard) id(respondent) keaa(23) eaaspec(x1 x2 x3 x4 x5 x6 x7 x8 x1 x2 x3 x4 x5 x6 x7 x8 x1 x2 x3 x4 x5 x6 x7)
            However, after running this command for 80h, I also did not get an output yet. Do you have a suggestion what the problem could be maybe?

            Many thanks in advance

            Eva Boonaert

            Comment


            • #7
              Thank you for providing more information about your dataset. The fact that the code is now running suggests that it was the misspecification issue that caused the error message.

              The eaalogit model can be difficult to get to converge. One thing you can try is to specify the trace option which will display the coefficient estimates in each iteration. If one of the ANA parameters is very large after several iterations you can specify full attendance to the corresponding attribute - see the help file for an example. I can't help you more than this I'm afraid.

              Arne

              Comment

              Working...
              X