Announcement

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

  • Creating a single table from tabulation of many similar variables using asdoc

    I have a dataset that has similar responses to different questions. For example Q1, Q2, Q3, ... Qn have all have coded responses of 1 for strongly disagree, 2 for disagree, 3 for agree, and 4 for strongly agree. I want to tabulate all these questions in one table using asdoc (available on SSC). Is there any option available in asdoc to do this?

  • #2
    This feature was added to asdocx (more details on asdocx are here). Here is an example where I use tabmany , which is asdocx's sub-command.

    Code:
     First Create an example dataset
    clear
    input str3 id int(i1 i2 i3 i4 i5)
    " 1" 1 4 2 3 5
    " 2" 1 3 3 2 4
    "3"   1 1 1 1 1
    "4"   2 2 2 2 2
    "5"   3 3 3 3 5
    "6"   1 1 1 1 1
    "7"   5 5 5 5 5
    "9"   4 1 5 4 4
    "10"  5 5 5 5 5
    "11"  2 1 4 2 1
    "12"  2 2 2 2 2
    end
    label values i1 responsesets
    label values i2 responsesets
    label values i3 responsesets
    label values i4 responsesets
    label values i5 responsesets
    label def responsesets 1 "Strongly Disagree", modify
    label def responsesets 2 "Disagree", modify
    label def responsesets 3 "Neutral", modify
    label def responsesets 4 "Agree", modify
    label def responsesets 5 "Strongly Agree", modify
    * Send to Excel
    Code:
    asdocx tabmany i1-i5
    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	54.0 KB
ID:	1586320


    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      There is a small update to asdocx's tabmany sub-command. It now accepts [if] and [in] qualifiers. The latest version of asdocx is
      Code:
      Sep 14, 2021: Version 1.8.3
      Regards
      --------------------------------------------------
      Attaullah Shah, PhD.
      Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
      FinTechProfessor.com
      https://asdocx.com
      Check out my asdoc program, which sends outputs to MS Word.
      For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

      Comment


      • #4
        Thanks you professor for the update. I have used many programs to manage results and tables. asdocx is super-easy and versatile. It exports to Word and Excel with no hassle.

        Comment


        • #5
          Hello everyone,
          I need your help. I am using the asdoc command to create a word report.
          I am trying to create a table that looks like this:
          Any hypoglycemia up to 36h Birth mode Gestational age at birth
          Vaginal C-section Total 34-<35 weeks 35- <36 weeks 36 - <37 weeks >=37 weeks Total
          No 24 81 105 18 28 54 5 105
          22.86 77.14 100.00 17.14 26.67 51.43 4.76 100.00
          53.33 50.00 50.72 47.37 43.08 56.84 55.56 50.72
          Yes 21 81 102 20 37 41 4 102
          20.59 79.41 100.00 19.61 36.27 40.20 3.92 100.00
          46.67 50.00 49.28 52.63 56.92 43.16 44.44 49.28
          Total 45 162 207 38 65 95 9 207
          21.74 78.26 100.00 18.36 31.40 45.89 4.35 100.00
          100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
          At the moment I have the results by birth mode and gestational age in separate tables by doing this:
          PHP Code:
          asdoc tabulate hypoglycemia_any del_modrow col append    nocf title(Any hypoglycemia between birth and 36h by delivery modefhc(\b)
          asdoc tabulate hypoglycemia_any ga_birthrow col  append    nocf title(Any hypoglycemia between birth and 36h by gestational age at birthfhc(\b
          Is there a way to combine as shown before?

          Thank you very much

          Comment

          Working...
          X