Announcement

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

  • Newbie question about summing multiple columns and calculating totals and means

    Hello,
    I am returning to STATA after a very long hiatus (I am essentially a beginner). I have done some straightforward analyses on age, sex and survey responses, but I need some advice on how to approach something. I know that once its explained I will have a facepalm moment.

    I have several columns which relate to the amount of foods consumed by respondents and I need to find the mean. There are 5 major food categories asked about, and these responses are in 5 columns. The repondents are asked "how many times per day do you eat X food" and the results can be tabulated as N times and N respondents which selected that rate of consumption. In excel I would multiply the n responsdents per rate of consumption to arrive at a total amount of consumption of that food group, then divide by the corresponding number of respondents to find the mean. I cannot figure this out in STATA.

    Any help is welcomed!

  • #2
    Anna:
    welcome to this forum.
    This seems to be a job for -egen- functions.
    An excerpt/example of your dataset, shared via -dataex- (see the FAQ), would increase your chances of getting more helpful replies. Thanks.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Dear Carlo, Many thanks for the welcome and the suggestion. I will do as you suggest. thanks

      Comment

      Working...
      X