Announcement

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

  • command doesn't work

    Dear all,

    I have 2 years experience using stata. I wanted to run do file I created yesterday and it worked. Today Stata didn't even want to run the command egen claiming it didn't recognize it. I use Stata IC on the remote desktop. Should I just wait since it might be the rush hours or is it something with my computer (virus or sth like that)?
    Last edited by sladmin; 28 Aug 2023, 09:39. Reason: anonymize original poster

  • #2
    Emlia:
    as per https://www.statalist.org/forums/help#question:, please:
    ...Never say just that something "doesn't work" or "didn't work", but explain precisely in what sense you didn't get what you wanted.
    Thanks.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      egen should work, period. I doubt that time of day or viruses have anything to do with that. A quick test is to try something undemanding in principle such as

      Code:
      sysuse auto, clear
      
      which egen
      
      egen mean = mean(mpg), by(foreign)
      and show us the results.

      EDIT: Typo fix. Sorry about that.
      Last edited by Nick Cox; 08 Feb 2022, 07:19.

      Comment


      • #4
        Nick Cox imagine if Stata issued an error code at midnight saying
        Code:
        "I'm tired, wake me up around 8am".
        error 9999;
        Boy, I sure would be in trouble were that the case.

        Anyways seriously, my initial suspicion is that the code you've ran has an egenmore function that the remote desktop doesn't have, but of course without seeing your code, I've no way of telling you.

        Comment


        • #5
          It worked

          Comment


          • #6
            Wait a minute, so it isn't that Stata doesn't work or even egen doesn't work, it's that you don't have closed parentheses for the by option.

            EDIT: Just as a note, one thing I've learned as someone who writes a/do code is that it isn't that "Stata doesn't work" or "want to work". Understand something: Stata is a machine. She has no wants or desires. It's a fancy calculator (putting it mildly), and only understands syntax according to its rules of ado and mata code.

            So, when Stata is giving you an error, it isn't that it's having a bad day or that it's just being difficult to toy with you. It's likely the case you've given Stata instructions in a way that it cannot understand what you want. And this happens to me and everyone else all the time. So my point is, the moment we start thinking of it as "I told Stata to do something against my wishes" when an error code comes up, the sooner we can diagnose the problem.
            Last edited by Jared Greathouse; 08 Feb 2022, 06:55.

            Comment


            • #7
              I've noticed it and corrected it and it worked. However, I don't know why Stata doesn't wanna run commands it run yesterday.
              E.g
              CODE]frame create myresults
              unexpected end of do-file
              command frame not defined by frame.ado
              E][/CODE][/CODE]
              It was the same case when I wanted to create egen. Is ist something with my file? It is very big and has more than 2 million observations.
              Last edited by sladmin; 28 Aug 2023, 09:39. Reason: anonymize original poster

              Comment


              • #8
                I don't care how big the dataset is.
                Just as a note, one thing I've learned as someone who writes a/do code is that it isn't that "Stata doesn't work" or "want to work". Understand something: Stata is a machine. She has no wants or desires. It's a fancy calculator (putting it mildly), and only understands syntax according to its rules of ado and mata code.

                So, when Stata is giving you an error, it isn't that it's having a bad day or that it's just being difficult to toy with you. It's likely the case you've given Stata instructions in a way that it cannot understand what you want. And this happens to me and everyone else all the time. So my point is, the moment we start thinking of it as "I told Stata to do something against my wishes" when an error code comes up, the sooner we can diagnose the problem.
                Note, I don't work with frames (perhaps unfortunately), so I can't comment on that. However, you'd still need to give a full minimal worked example with your new problem.

                Comment


                • #9
                  Please note typo fix in #3.

                  For once I am the nice cop.

                  These questions are hard to answer and it is hard for you to give us the evidence we need.

                  Was it exactly the same do-file and exactly the same dataset, so that you were trying exactly the same thing? Did you fire up Stata in exactly the same way? What does remote mean here? These are possibly stupid questions but I can't think of a better one.

                  There can be bizarre problems with do files that have been anywhere near an application that uses non-printable formatting characters. MS Word is one culprit -- and this forum's software can be another.

                  Comment

                  Working...
                  X