Announcement

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

  • unknown function egen ...

    Good afternoon,
    Did anyone have a problem with egen command, when it didn't work with any function? The problem is that even if I try to run xttest1 of xtcsd Stata gives me back an error "unknown egen function max()" in the former case and ""unknown egen function group()" in the latter.

    Moreover, it does not work even if I try to generate simple variables like mean by ().
    Stata's output:
    . egen mdLiab=mean(dLiab), by(company)
    unknown egen function mean()
    r(133);

    If trying to balance a panel using xtbalance, Stata says: "unknown egen function rmiss()".

    I would really appreciate any feedback as it seems that without this egen command I cannot run commands that I need.

  • #2
    What version of Stata are you using?

    Code:
    mean() 
    group()
    max()
    have been in egen since very early days.

    rmiss() is the old name for rowmiss() but should not cause any problem

    You should give the provenance of the user-written commands you're using. In each case they set version back to 6 or 7 but I'd be surprised if that was the source of the problem.

    This works in 14.2:

    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . version 6: egen foo = group(headroom)

    Comment


    • #3
      I am using Stata 13, and I just gave several examples of errors, but in my case egen doesn't work with any function. For example, here I didn't use egen explicitly, I just tried to run xtfmb, but the result is as follows:
      Click image for larger version

Name:	Image 1.png
Views:	1
Size:	2.9 KB
ID:	1360258

      Comment


      • #4
        Try this then


        Code:
        which _ggroup, all
        If you see nothing, your installation is corrupt somehow.

        If you see a filename ending in _ggroup.ado, your problem is somehow a side-effect of those commands you're running (and I am still puzzled).

        Or your adopath is messed up. Show the results of

        Code:
        adopath

        Comment


        • #5
          I see a filename ending in _ggroup.ado...
          But it seems to me that the problem is in egen command itself. It doesn not work with sum, medium, with anything.

          Comment


          • #6
            I'd talk to StataCorp technical support. They will need lots more detail.

            Comment


            • #7
              Good afternoon,
              I am facing the exact same problem as Liza did, with the egen function, for which I cannot use any function (such as mean).
              I can also see a filename ending in _ggroup.ado and regarding the adopath, there they are:

              . adopath
              [1] (UPDATES) "C:\Users\LAURED~1\AppData\Local\Temp\Rar.732\Stat a 12\ado\updates/"
              [2] (BASE) "C:\Users\LAURED~1\AppData\Local\Temp\Rar.732\Stat a 12\ado\base/"
              [3] (SITE) "C:\Users\LAURED~1\AppData\Local\Temp\Rar.732\Stat a 12\ado\site/"
              [4] "."
              [5] (PERSONAL) "c:\ado\personal/"
              [6] (PLUS) "c:\ado\plus/"
              [7] (OLDPLACE) "c:\ado/"

              Did you happen to solve this issue?
              Thank you very much in advance for your kind help.

              Comment


              • #8
                Also see this post.

                Best
                Daniel

                Comment


                • #9
                  Another thought. Is it just -egen-? If you replace -egen- with some other valid Stata command in the exact same place in the code, does Stata tell you that that command is also unrecognized?

                  If changing the command fixes the problem, then I would suggest you go straight to technical support about the problem with -egen-. But if you can't get any command to execute at that point in the do-file it may be something different. I have noticed that sometimes when I copy/paste code from websites (including this Forum), or from Microsoft Word documents, the code will run up to a certain line, and then from that point on Stata says that it doesn't recognize the command, no matter what command is there. If I paste over the command that is there with a different one, I get the same error message.

                  I don't know what the exact cause of that is. I suspect that there are some non-printing control characters embedded in the code that come from the original source and that are choking the syntax parser. Fortunately, there is an easy solution. Copy all the code and paste it into a simple text editor. (I run Windows, so I use Notepad for this purpose.) Then copy all the code from Notepad and paste it back into the do-file editor. Everything runs fine then. Notepad seems to be able to launder the text and eliminate control characters.

                  Comment


                  • #10
                    Hi ad. I'm using Stata version 15.1. I'm running xtwest commmand. But there is an error that unknown egen function rowmiss() r(133). And I don't know what to do. Please help me!!!

                    Comment


                    • #11
                      xtwest is community-contributed software, as you are asked to explain (FAQ Advice #12). The latest version I can see being

                      SJ-16-1 st0146_1 . . . . . . . . . . . . . . . . . Software update for xtwest
                      (help xtwest if installed) . . . . . . . D. Persyn and J. Westerlund
                      Q1/16 SJ 16(1):244
                      fixes an issue that caused the program to fail with an "invalid
                      operator" r(198) error message and the option mg added


                      There should not be a problem with calling egen, rowmiss() unless your Stata installation is itself corrupted.


                      When I go

                      Code:
                      which _growmiss
                      in Stata 15 I see

                      Code:
                      . which _growmiss
                      XXX\Stata15\ado\base\_\_growmiss.ado
                      *! version 1.0.0  04oct2004
                      where XXX is just blanking out stuff that may well be different on your set-up, just as forward slashes rather than backward slashes may apply. Here the detail you are not expected to know is that egen functions all rely on programs whose names start with _g.

                      Please repeat that command in your Stata and tell us what you get.


                      Comment


                      • #12
                        Hi I'm using Stata version 14.2. I'm running melogit command.

                        melogit hypertension || districts:

                        But there is an error that unknown egen function group() r(133). Please help me !!

                        Comment


                        • #13
                          Code:
                          which _ggroup
                          should show you a file with name _ggroup.ado somewhere on your system.

                          This kind of error is usually associated with pirated or cracked versions of Stata.

                          Comment


                          • #14
                            It is showing a filename ending in _ggroup.ado

                            Comment


                            • #15
                              If #12 is still true, then your Stata is installed incorrectly. I'd contact StataCorp technical services for support. Make sure to cite your registration number. https://www.stata.com/support/faqs/t...-tech-support/
                              Last edited by Nick Cox; 28 Jun 2020, 06:20.

                              Comment

                              Working...
                              X