Announcement

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

  • #16
    Dear William,
    I find your reply very unethical and the code is written by myself for myself. You can not just imply such matters.

    Many thanks.

    Comment


    • #17
      My apologies: many Statlist members find themselves in the unfortunate position of taking over code originally written by someone else who is no longer available, and then have trouble understanding the original author's intent. I thought perhaps that was your case.

      If you have not written an "if command" in your 700 lines, then indeed upload the do-file for others to look at. (I don't think 700 lines can be pasted into a code block in a post here.)
      Last edited by William Lisowski; 13 Jun 2022, 11:38.

      Comment


      • #18
        Martin:
        there's nothing unethical in asking, as William politely did, if you're running somebody's else code.
        It may happen among colleagues engaged in the very same research project and there's nothing sinister in that (not to say that it does not automatically imply any charge for plagiarism).
        I followed up your query and, even I could not help, it seems to me that William's main concern was about revising 700 lines of code to sniff out the culprit, if any: this is a legal concern.
        On a personal note, even I did not have the chance to know William personally so far, I can say that he is skilled and kind at the same time.
        Hence your reaction seems a bit of a stretch, possibly due to the fact that you cannot find the reason why your dataset does not behave as expected following the instructions that you coded up yourself (which is somethng that happens on a daily basis to me).
        Last edited by Carlo Lazzaro; 13 Jun 2022, 11:42.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #19
          Is it possible that this segment of code is under a #delimit ; condition?

          Comment


          • #20
            Perhaps, we could phrase and choose our words differently. The code was written by myself for myself by learning from mistakes.
            The code has been reviewed line by line by myself making sure I get the right figures replaced.

            I do not understand why if I run the code line by line everything works smoothly
            If I select all some of the code is ignored.

            I have RE-REad the IF command vs IF qualifier stata help.

            I will rephrase my if commands with :
            either

            while x == 3 { replace x = 4 or
            replace x = 4 if x == 3 I will see which works. If it doesn't there is the official STATA web based course coming up. Many thanks

            Comment


            • #21
              Martin:
              even I'm not English mother-tongue (and the mischievous comment may be: no worries, we notice it! ), I cannot find any offending words/hidden meanings in William's reply (and Italians are, on average, easy-reacting people).
              No one doubt that you wrote and tested your code yourself if you tell us so.
              Unfortunately, it does not seem to behave as expected and you received helpful advice about the issue.
              If I may, I would consider the patience and the time William carefully devoted to your query, without having your code available and, more substantively, that he apologized immediately upon your reacting on something that apparently hurted you and that I still find as a perfectly legal question.
              Different takes, possibly...
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #22
                Originally posted by David Kantor View Post
                Is it possible that this segment of code is under a #delimit ; condition?
                That is an alternative I hadn't considered, but a little experimentation shows that the commands would appear as continuation lines. Compare this to the output shown above.

                Code:
                . rename x = a
                > rename y = b
                > rename z = c

                Comment


                • #23
                  I do not understand why if I run the code line by line everything works smoothly
                  If I select all some of the code is ignored.
                  Neither do the rest of us.

                  To explain why the code is being ignored, we need to see all of your do-file, because the code in the do-file before and after the code that is being ignored is as important as the code you show us.

                  Something in the code we have not been shown is causing Stata to ignore the commands which are otherwise correct, as your testing has confirmed. So changing the commands that are being ignored won't solve the problem. What we need is to to find the command that is causing subsequent commands to be ignored. It's not in what you've shown us so far, so it must be in some other part of your do-file.

                  I remain willing to look at your 700 lines of code if you can upload the do-file here. It can be uploaded the same way as screen shots.

                  Comment


                  • #24
                    My question here is how come no data example or code has been provided yet? Dropping variables is a pretty straightforward question to address, and I think if code had been provided and asked for at first, we'd be a little further down the way to solving this.

                    So to put this to bed, please provide (not a screenshot) a minimal worked example which allows us to reproduce the problem. Precisely, I'd like a dataex example of the variables you'd like to drop, as well as the context of the code the error appears within. All of this should be in CODE blocks to facilitate this. Of course, it is that "context" which appears to be the tricky part here in this instance.

                    On a related point, this is why I have multiple do files for every single task I do in a project (I mean, one do file for one graph). I'm not totally perfect about this, but it helps me at least debug errors and ideally avoid them since smaller do files give you smaller chunks of code to look at.

                    Comment


                    • #25
                      Hi all, just wanted to give you an update on this. I reviewed my 3000 word of code which I wrote and found the problem
                      In my do file - one of my text comments started off with just **** rather than //**
                      From then onwards stata didn't behave - didn't drop values, didn't replace values with the if command.

                      Just edited my do file as explained above and it now works

                      Comment


                      • #26
                        Please also note, that I am unable to provide datex because as mentioned previously not everyone is in the same situation. I need to access stata on a remote platform which does not belong to myself and it itself is not connected to the internet. So each time I need something extra than whats available in 15.0 one needs to email and wait for the request to either be approved/not approved/ wait.

                        Comment


                        • #27
                          Martin:
                          thanks for the great news as per your #25.
                          Happy with reading that your whole-hearted efforts were successfuly in the end.
                          Kind regards,
                          Carlo
                          (Stata 19.0)

                          Comment


                          • #28
                            As a note for those who find this topic at a later date while searching for help with a similar problem, the output of
                            Code:
                            help comment
                            has a thorough discussion of the syntax used in Stata to denote text to be treated as comments.

                            Added in edit: Subsequent speculation removed.
                            Last edited by William Lisowski; 15 Jun 2022, 07:22.

                            Comment

                            Working...
                            X