Announcement

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

  • Splitting, Freezing, Separating Numeric Variable

    Hello - my question seems quite easy but I cannot find the correct language to describe the command I am needing.

    I have a dataset with years 2011-2020. I only want to use the data for a specific year (i.e., only 2011 for example). In SPSS I can "split the file" so that only the data from 2011 is used in the analyses. But I do not know what the same/similar command is in Stata. The split and separate commands do not work because this is stored as a numeric variable. Also, I don't want to save multiple files for each of the years I am using as I already have the individual years and this is a merged dataset.

    Thank you - Stacey

  • #2
    Plz use bysort year: command like tab etc variable else
    command variable if year==2011

    Comment


    • #3
      See the output of
      Code:
      help if
      to learn how to limit a command to a single year of your data. See the output of
      Code:
      help by
      to learn how to run a command one year at a time for each year of your data.

      Comment

      Working...
      X