Announcement

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

  • cgmreg - error message

    Hi,

    I'm relatively new to stata, and cant seem to get around this error message. I am trying to carry out a reg with two-way clustering, by using the ado file provided by Cameron, Gelbach and Miller (2006).

    Website: http://cameron.econ.ucdavis.edu/research/papers.html
    The ado file is called "cgmreg.ado".
    I have tried to run the test code provided by the authors to see how it works, before I try it on my data. The test code:
    Code:
    #delimit clear /* generate data */ set obs 100 gen x = invnorm(uniform()) gen y = 2 * x + invnorm(uniform()) gen clu_id_1 = floor((_n-1) / 10) + 1 gen clu_id_2 = _n - ((clu_id_1-1) * 10) /* estimate model */ cgmreg y x , cluster(clu_id_1 clu_id_2)
    But every time I run the test I am getting this error message.
    _robust_work(): 3102 function found where matrix required
    rob__compute(): - function returned error
    _robust(): - function returned error
    _robust2(): - function returned error
    <istmt>: - function returned error
    r(3102);
    Any help would be appreciated. Thanks
    Last edited by Mohamed Ayaz; 22 Jan 2019, 00:56.

  • #2
    I wasnt able to reproduce your error.
    A simple advice will be to restart your Stata session. And let us know which version of Stata you are currently working with.
    Best
    Fernando

    Comment


    • #3
      Thank you for your reply.

      I just got it fixed, once I switched Stata versions. Was using stata version 15, the code works fine in Stata version 14.

      Comment


      • #4
        Perhaps it will work in version 15 if version control tells Stata to run it using version 14 syntax.
        Code:
        version 14: cgmreg y x , cluster(clu_id_1 clu_id_2)
        See the output of help version for an explanation of this possible magic. The source code in cgmreg.ado unfortunately does not include a version command at the top of the file to tell Stata to interpret the commands under the syntax of the version under which cmgreg was written.

        Comment


        • #5
          Thank you, will look into that.

          Comment


          • #6
            I have just tested cgmreg in Stata 15.1 on my Mac, without using version control, and it functioned without the error documented in post #1.

            I withdraw my suggestion of using version control made in post #4, and I no longer feel that the Stata 15 as such is at the root of the problem, although perhaps there was a problem that was later resolved in a Stata update.

            Perhaps using the update command to bring your Stata 15 to the latest version, if you have not already done so, may resolve the problem.
            Code:
            . about
            
            Stata/SE 15.1 for Mac (64-bit Intel)
            Revision 17 Dec 2018

            Comment


            • #7
              Hi all,

              I ran the same code as discussed in this thread above , provided by Cameron, Gelbach and Miller (2006).


              Originally posted by Mohamed Ayaz View Post
              Hi,

              I'm relatively new to stata, and cant seem to get around this error message. I am trying to carry out a reg with two-way clustering, by using the ado file provided by Cameron, Gelbach and Miller (2006).

              Website: http://cameron.econ.ucdavis.edu/research/papers.html
              The ado file is called "cgmreg.ado".
              I have tried to run the test code provided by the authors to see how it works, before I try it on my data. The test code:
              Code:
              #delimit clear /* generate data */ set obs 100 gen x = invnorm(uniform()) gen y = 2 * x + invnorm(uniform()) gen clu_id_1 = floor((_n-1) / 10) + 1 gen clu_id_2 = _n - ((clu_id_1-1) * 10) /* estimate model */ cgmreg y x , cluster(clu_id_1 clu_id_2)
              But every time I run the test I am getting this error message.
              Any help would be appreciated. Thanks
              However, when I ran the regression, I got the error message-

              cgmreg y x, cluster(clu_id_1 clu_id_2)
              option / required
              r(198);


              Kindly help.

              Comment

              Working...
              X