Announcement

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

  • Output changes when code is rerun

    Dear Statalist Forum,

    I have the following issue: When I run my whole code (beginning with clear, use, and data cleaning), I get the result that the variable newport_sa == 1 frequency is 0. Once I only rerun the specific line
    Code:
    replace newport_sa =1 if ((original_sa < changed_sa) & (changed_sa < endw_sa)) | ((original_sa > changed_sa) & (changed_sa > endw_sa)) //changed allocation is between original and endweight
    and then rerun
    Code:
     count if newport_sa == 1
    , the result suddenly changes to 7, how it should be.

    Could anyone please explain what is happening and why my results are inconsistent? How can I prevent these changes in output?

    Thank you very much in advance!

  • #2
    I figured it out; I had some other variables with fewer restrictions coded as 2 and 3. Therefore, the output for 1 changed.

    Comment

    Working...
    X