Announcement

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

  • r(111) error

    I'm have uploaded data from excel and I can see it in the data editor. I am trying to manipulate the data with keep and drop using the syntax:

    keep if Sample == Yolk Sac.
    I keep getting the message:
    Yolk not found
    r(111).

    I have tried a few different keep/drop commands and variables and always get the message that by observation isn't found. I tried going into excel and removing all missing observations before uploading the data.

  • #2
    -keep if Sample == Yolk Sac- is not legal Stata syntaax. On the guess that Sample is a string variable in your data set and that you want to keep only those observations where that variable takes on the values Yolk Sac, the correct syntax would be:
    Code:
    keep if Sample == "Yolk Sac"
    The quotation marks are obligatory.

    If that doesn't solve your problem, we need to see actual example data and metadata, provided by using the -dataex- command. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    When asking for help with code, always show example data. When showing example data, always use -dataex-.

    Finally, it is the norm in this community that we use our real first and last names as our username here. That promotes collegiality and professionalism. Please click on Contact Us in the lower right corner of this page and message the system administrator requesting correction of your username. Thank you.

    Comment


    • #3
      Thanks for help, it worked!

      Comment

      Working...
      X