Announcement

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

  • dtable with limited categorical responses

    I'm using the dtable commands to generate summary tables/descriptive statistics. Right now I'm generating tables that include all responses, e.g.,
    Depression
    No 90 (90%)
    Yes 10 (10%)
    using syntax like
    Code:
     dtable i.(depression),  title("Mental Health Prevalence")  note(Results reported as N(%)) nosample

    What I'd really like to get is
    Depression 10 (10%)
    Any thoughts on code for this? I'd love to find some option that would limit to just showing 'yes' responses. Thanks!

  • #2
    Assuming that your depression variable is coded 0 for no and 1 for yes:
    Code:
    dtable 1.depression, title("Mental Health Prevalence") note(Results reported as N(%)) nosample

    Comment


    • #3
      This is terrific, thank you!

      Comment

      Working...
      X