Announcement

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

  • Problems using cem

    Hello,

    I am having problems using coarsened exact matching (cem) on Stata.

    when running the command

    Code:
    cem insaic_lag2 insaic_lag3 insaic_lag4 insaic_lag5 insaic_lag6 realyinsaic_lag1Caguas Bayamon Mayaguez Ponce SanJuan Aguadilla Arecibo Carolina Guayama Humacao, treatment(audited) k2k
    I get back this error:
    Code:
     cemStata():  3001  expected 6 arguments but received 7
                     <istmt>:     -  function returned error
    Due to the permissions on my laptop (pertaining to existing next.trk file) i could not install
    Code:
    ssc  install cem
    I also tried running the following command, but also get an error message.
    Code:
    net from http://gking.harvard.edu/cem/
    To get around this, I created separate .ado files for cem.ado and cem-mata.ado, and a manually added the lcem.mlib file to my c:\ado\plus/ file. May the error lie here?

    Any insights would be very helpful.

    Thank you
    Sara

  • #2
    To back up, are you unable to install any SSC packages on your laptop? Or is it just cem? You might try

    ssc uninstall cem
    ssc install cem
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Yes, I am unable to install SSC. When I install an SSC command i receive a "next. trk File already exists error" and am unable to erase it.

      I tried running the example file they provide here, and it seems to be running fine. I suspect the error must be related to how I am defining the variables.

      Thank you for your response, and any other insights are again, appreciated.
      Sara

      Comment


      • #4
        Well, my first impulse would be to rename stata.trk and then see if I can install cem. Maybe stata.trk is corrupted.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          I got it working. I was able to run it using do "url".
          Thank you, again

          Comment


          • #6
            Hi, after runnig cem I receive this error message: file c:\ado\plus/c/cem-mata.do not found
            Can anyone help? (I tried to reinstall, but does not help)

            Comment


            • #7
              I assume you got this from SSC? cem-mata.do is listed as an ancillary file, and is not automatically installed. Try

              ssc install cem, all
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              Stata Version: 17.0 MP (2 processor)

              EMAIL: [email protected]
              WWW: https://www3.nd.edu/~rwilliam

              Comment


              • #8
                Thank you, the file was succesfully copied however error message still occurs..

                Comment


                • #9
                  Did it get copied to the right location? You want it in c:\ado\plus/c/
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  Stata Version: 17.0 MP (2 processor)

                  EMAIL: [email protected]
                  WWW: https://www3.nd.edu/~rwilliam

                  Comment


                  • #10
                    Yes, it did, only problem that comes on my mind could be that it is not *.do file but *.ado file. If I go back to that error message it says: "file c:\ado\plus/c/cem-mata.do not found
                    (error occurred while loading cem.ado)". But I wonder why stata says *.do file when it suppose to be *.ado file.

                    Comment


                    • #11
                      looking at the ado file, I see that "cem-mata.do" is called in the very last line and it is called using a local; show us the result of:
                      Code:
                      di c(sysdir_plus)
                      adopath

                      Comment


                      • #12
                        .
                        . adopath
                        [1] (BASE) "C:\Program Files (x86)\Stata15\ado\base/"
                        [2] (SITE) "C:\Program Files (x86)\Stata15\ado\site/"
                        [3] "."
                        [4] (PERSONAL) "c:\ado\personal/"
                        [5] (PLUS) "c:\ado\plus/"
                        [6] (OLDPLACE) "c:\ado/"

                        Comment


                        • #13
                          and what more, "cem-mata.do" file is not in my folder anymore. If I reinstall cem again (code : ssc install cem, all), the "cem-mata.do" file is not there.

                          Comment


                          • #14
                            Can you provide a replicable example, e.g. using one of Stata's datasets? I have a feeling it is a problem on your end but maybe not.
                            -------------------------------------------
                            Richard Williams, Notre Dame Dept of Sociology
                            Stata Version: 17.0 MP (2 processor)

                            EMAIL: [email protected]
                            WWW: https://www3.nd.edu/~rwilliam

                            Comment


                            • #15
                              Thanks, it seems it is working now. I found that "cem-mata.do" file by chance in totally unexpected location and after copying it into right place it looks like it is working now. I dont know how that file was created and how it ended there but it is working. I am pretty sure, that for the first time it was *.ado file and not *.do file. Anyway, thanks a lot. Miroslav

                              Comment

                              Working...
                              X