Announcement

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

  • Counting within a variable

    Sorry if this is trivial, but I can not find anything online nor seem to get it to work myself. I have a data set made of 2 waves that I have combined. The variable "survey" denotes if the observation is from the first (=1) or the second wave (=2).

    How do I do a simple count within the survey variable to check if the number of observations of the first wave (1) are roughly equal to those in the second wave (2)?

  • #2
    Please read the FAQ. There you'll find advice about sharing data/command/output.

    That said, just type - help count - in the command window, for the command - count - allows for "if" as well as "by".
    Best regards,

    Marcos

    Comment


    • #3
      Adding to the advice from Marcos, another approach is
      Code:
      tab survey

      Comment


      • #4
        In addition to above useful posts, you may use the following approach to get more information on the variable. Hope this helps.

        Code:
        sum survey, detail

        Comment

        Working...
        X