Announcement

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

  • Help with Creating Weighted Table Using svy: and collect

    Hi everyone,

    I’m currently trying to create a weighted table in Stata similar to the example image I’ve attached. I’ve been running into difficulty with two main issues:
    1. Creating the conditions under a section
      • Specifically, I want to show “number of days iron supplements were taken” using the following conditions (as reflected in the attached image) under a table section, using my survey dataset with weights.
    2. Merging multiple collections/sections into a single table
      • I’ve tried using svy: commands along with collect, but I’m not sure how to combine multiple variables/sections into one cohesive table with counts and weighted percentages. I’ve already generated the survey weights and set up the svyset design.
    Any guidance or examples on how to:
    • Properly use svy: proportion with conditions to reflect days of iron intake, and
    • Merge multiple collections/sections into a single table using collect
    This would be greatly appreciated. I also provided a sample dataset and example code if needed. The generated weights are already in the attachment.

    Thank you in advance!
    Attached Files

  • #2
    *correction: the denominator for computing the percentage for the second section should be the total number of women who consumed iron-supplements, variable: d31_given_bought

    Comment


    • #3
      if you want to be able to show multiple different statistics in one table, i would use just the regular table command plus your survey weights. it's more flexible

      Comment

      Working...
      X