Announcement

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

  • Error cmp (conditional mixed process) command

    Dear Stata users,

    I am using Stata version 11.2 in a Mac to estimate models using the user-written-cmp- (conditional mixed process) command . I installed the version from ssc, and if I check with -ssc install cmp-, Stata says that the latest version is installed.
    I am having trouble replicating the cmp examples displayed in the Stata Journal paper (http://www.stata-journal.com/article...article=st0224). As directed by the author's article, I do :

    cmp setup
    webuse laborsup
    replace fem inc = fem inc - 10
    cmp (kids = fem inc male educ), indicators($cmp cont) quietly

    I get the error:
    "Indicator for kids must only evaluate to integers between 0 and 9.
    invalid syntax"
    I have tried
    -update all
    -adoupdate cmp, update
    -adoupdate ghk2, update

    They are all updated. Any suggestion ?

    Best,
    Celia P.



  • #2
    Welcome to Statalist!

    On my Mac running 14.1 I followed the indicated steps and did not receive the error message you did.

    Statalist can better help you if we know, not only what commands you have tried, but also what Stata told you along the way. Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. See especially sections 9-12 on how to best pose your question.

    To assure maximum readability of results that you post, please copy them from the Results window or your log file into a code block in the Forum editor, as explained in section 12 of the FAQ, or by typing in the code delimiters manually. For example, the following:

    [code]
    . sysuse auto, clear
    (1978 Automobile Data)

    . describe make price

    storage display value
    variable name type format label variable label
    -----------------------------------------------------------------
    make str18 %-18s Make and Model
    price int %8.0gc Price
    [/code]

    will be presented in the post as the following, much more readable:
    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . describe make price
    
                  storage   display    value
    variable name   type    format     label      variable label
    -----------------------------------------------------------------
    make            str18   %-18s                 Make and Model
    price           int     %8.0gc                Price

    Comment


    • #3
      Thanks William for your note. I would rewrite my question with those considerations taken into account. Would you recommend to start a new thread or to follow up on this one ?

      Celia P.

      Comment


      • #4
        Thank you, Celia! Just continue on this thread, there is no need to start a new one. Some members may have subscribed to this thread waiting to see what the new details will bring.

        I should have said that providing an example for Statalist user to try to reproduce your problem was very good problem presentation; too many questions just state that something "doesn't work", which gives very little to go on. On a 10-point scale, you started at a 7 or 8; if it weren't that the example wouldn't create the error on my system we might already have had an answer. Instead we have a more mysterious problem.

        Comment


        • #5
          Whoops sorry, that is a bug, affecting Stata versions < 12.1. Please type "which cmp" to find the current cmp.ado, save the attached version, and restart Stata. I think it will work then. I'll have this posted publicly.

          cmp.ado

          Comment


          • #6
            Thanks William and David for your replies. I have saved the .ado version David sent and it worked well.

            Comment


            • #7
              I am facing a similar problem using Stata 14.
              I have tried all possible structures but I still can't forge ahead

              Comment

              Working...
              X