Announcement

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

  • Summary statistics and tabulate based on a new created variable

    Hello all,

    I have a variable age, but I'm only looking at two age groups. I created a variable for this at this was fine for the first wave. Now I received the second dataset collected in the same group and now a some of the participants are 20 and therefore not included in my analysis. I made a new variable generate age_10_19 = b05 if b05 >= 10 & b05 <= 19 .
    I only want to analyse the participants who are now included in this set.
    So for example: tabulate education gender, row
    How can I get the n and the % only for the participants from variable age_10_19.
    Thank you once again for you time.
    Anna

  • #2
    To include all values in the range 10-19

    Code:
    tab education gender if inrange(b05, 10, 19), row

    To include only 10 and 19

    Code:
    tab education gender if inlist(b05, 10, 19), row
    See

    Code:
    help if
    Code:
    help inrange()
    Code:
    help inlist()
    Last edited by Andrew Musau; 24 May 2023, 10:51.

    Comment


    • #3
      Thank you so much.

      Comment

      Working...
      X