Announcement

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

  • Frequency table for multiple variables

    Dear all,

    As a fairly new user of Stata, I would appreciate any suggestions to create a frequency table of my data. I have already searched through the forum and Google, but I cannot seem to figure out a solution.

    I have developed a questionnaire to ask people how often they have consumed foods from a certain food group (my variables). They can indicate: 0 (never), 2, 4, 13, 14 or 30 days (each day) over the past month.

    To make it simple, my dataset looks similar to this:
    Variables: 1_grains, 2_meat, 3_vegetables (etc.)
    Response categories: 0, 2, 4, 13, 24, 30
    n = 80.

    Now I would like to know how many of my respondents have consumed at least 2 days of the month (response category ≥2) a food from a food group. I can do this one by one with tabulate:

    . tab 1_grains if 1_grains > 0
    Click image for larger version

Name:	output1.JPG
Views:	1
Size:	10.9 KB
ID:	1487852


    So 77 out of 80 people have eaten a food from the food group "grains". So I can either do this all manually, but I assume there must be an easier way, to create something like this:
    Food group n (days consumed > 0) Percentage
    1_grains 77 96%
    2_meat 30 38%
    3_vegetables 45 56%
    A next step would be to put these percentages in a graph, but if I can get the numbers and percentages into a table that would already be great.

    Thanks in advance for any help on this!

    Kind regards,
    Brenda
    Last edited by Brenda de Kok; 13 Mar 2019, 06:42.
Working...
X