Announcement

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

  • Stata added observations with very small or very large values

    Strange Stata issue.

    For unclear reasons, Stata recently added a number of observations with bizarre, very small or very large values (eg, height and weight vars in attached screenshot). Other vars have seemingly random characters added in these observations (eg, tc variable in screenshot). These values clearly do not make sense for the variables in which they appear and the observations were not in the original dataset.

    These values appeared seemingly out of nowhere, and did not follow a merge command. They seem to have appeared after running the loop pasted below, though I can't be certain exactly when these observations appeared. I'm using Stata 12 (a bit outdated I know but works for me).

    What might be causing this problem?

    ************************************************** **********************
    capture noisily drop lastwt_ind
    capture noisily gen lastwt_ind =.
    label var lastwt_ind "most recent sess-associated wt by participant"
    levelsof mid, local(mids)
    foreach mid of numlist `mids' {
    sum cdt if mid==`mid' & weight !=.
    capture noisily replace lastwt_ind=1 ///
    if mid==`mid' & cdt==`r(max)'
    }
    Attached Files

  • #2
    Have you gone back and rerun the program containing the suspect code? Does the problem recur?

    I've seen similar issues before on Statalist and believe they wound up being irreproducible. and thus attributed to a transient hardware error.

    There is certainly nothing in any Stata code I can imagine that would produce the sort of problem you show.

    Comment


    • #3
      Re-running the code does not reproduce the issue. However, strangely, simply copying the data file does cause the issue to arise, even without running any code.

      Comment


      • #4
        How are you copying the data file? That is, doing a use-and-save within Stata, or doing something outside of Stata?

        Comment


        • #5
          I noticed simply when copying the .dta file using the Finder (Mac OS X), outside of Stata, that it caused the issue.

          Comment


          • #6
            Wow, as a Mac user I've never had that happen.

            I would re-create the file you are copying, but saving with a new name, and see if the re-created version exhibits the same behavior. In either event, this would be a good question to refer to Stata Technical Services at https://www.stata.com/support/tech-support/contact/ to see if they can shed any light on it. But really I think this is most likely a (hopefully transient) hardware problem.

            Comment

            Working...
            X