Announcement

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

  • asdoc sum - does not allow analytical weights

    Dear Members,

    I am dealing with DHS dataset. I have individual sample weight (6 decimals) in my dataset. I have divide it to 1000000. I named it as"wgt"
    I try to produce sum stats. When I do this, I use sum x1 x2 x3 .... [aw=wgt]. No problem with that. It gives mt stats.
    However when I try to export it to MS word, I use asdoc sum x1 x2....[aw=wgt] it says "aweights" are not allowed. As far as I know, when reporting descriptive stats, you need to use aweights. But, I dont understand why I could not export them

    This code works so well: sum bfduration2 survey_year female child_birth_year child_birth_month birthweight mother_age wealth_index rural_urban region5 [aw=wgt]
    But this does not: asdoc sum bfduration2 survey_year female child_birth_year child_birth_month birthweight mother_age wealth_index rural_urban region5 [aw=wgt]

    Thank you so much.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(bfduration2 survey_year female child_birth_year child_birth_month birthweight mother_age wealth_index rural_urban region5) double wgt
    30 2018 1 2014  9   3.2 28 4 1 1 2.356055974960327
    12 2018 1 2016  1  3.56 30 5 1 1 2.356055974960327
     8 2018 0 2018  2  3.95 29 5 1 1 2.356055974960327
    18 2018 0 2014  2   3.6 35 5 1 1 2.356055974960327
    19 2018 1 2014  3   2.1 30 4 1 1 2.356055974960327
    18 2018 0 2014  4   3.3 41 3 2 1 2.444962978363037
    18 2018 1 2014  2   2.5 35 1 2 1 2.444962978363037
     3 2018 1 2015  6   3.5 26 1 2 1 2.444962978363037
    10 2018 1 2016  8     . 43 1 2 1 2.444962978363037
     2 2018 1 2018  8  2.77 32 2 2 1 2.444962978363037
    36 2018 1 2014 10   4.2 37 2 2 1 2.444962978363037
    18 2018 1 2013 11   3.4 23 3 2 1 2.444962978363037
    24 2018 0 2015  7  3.26 42 3 1 1 2.356055974960327
    24 2018 0 2016 10   4.8 22 5 1 1 2.356055974960327
     8 2018 0 2014  4   3.2 28 1 1 1 2.356055974960327
     1 2018 0 2018  9  2.78 32 3 1 1 2.356055974960327
    20 2018 1 2016  3  3.64 44 5 1 1 2.356055974960327
    10 2018 1 2017 12  4.23 31 4 1 1 2.356055974960327
     7 2018 0 2016 11   3.8 32 5 1 1 2.356055974960327
    24 2018 1 2013 12  3.14 35 5 1 1 2.356055974960327
     6 2018 1 2018  4   2.9 24 3 1 1 2.356055974960327
    14 2018 1 2017  8     3 29 2 1 1 2.356055974960327
    27 2018 0 2015  9  4.08 29 4 1 1 2.356055974960327
    26 2018 0 2016  9  3.48 35 5 1 1 2.356055974960327
    18 2018 1 2015  7   3.1 26 2 1 1 2.356055974960327
     9 2018 1 2017  4     3 33 2 1 1 2.356055974960327
    15 2018 1 2017  2   3.6 36 5 1 1 2.356055974960327
    21 2018 1 2017  1   4.1 26 5 1 1 2.356055974960327
    13 2018 1 2017  9   2.9 32 4 1 1 2.356055974960327
    13 2018 1 2017 10   3.9 34 5 1 1 2.356055974960327
    35 2018 1 2015 12  3.01 32 5 1 1 2.356055974960327
     6 2018 1 2018  1 3.295 33 3 1 1 2.356055974960327
     3 2018 1 2018  8   3.5 27 4 1 1 2.356055974960327
     2 2018 1 2014  1   3.5 41 4 1 1 2.356055974960327
     7 2018 0 2017  5  3.43 41 4 2 1 2.378074884414673
    21 2018 1 2014  6  3.34 28 2 2 1 2.378074884414673
     8 2018 1 2018  2  2.26 35 3 2 1 2.378074884414673
     1 2018 0 2017 12   3.5 19 1 1 1 2.356055974960327
     5 2018 1 2018  5  2.99 23 1 1 1 2.356055974960327
    12 2018 0 2017 10  3.68 22 1 1 1 2.356055974960327
    12 2018 1 2017  3   3.5 26 5 1 1 2.356055974960327
    18 2018 1 2016  7     4 22 1 1 1 2.356055974960327
    10 2018 1 2015  1   3.5 35 5 1 1 2.356055974960327
    36 2018 0 2014  6  3.06 41 5 1 1 2.356055974960327
    18 2018 0 2014  8   3.6 37 5 1 1 2.356055974960327
     4 2018 1 2018  5  3.46 33 5 1 1 2.356055974960327
     3 2018 1 2018  7   3.2 35 5 1 1 2.356055974960327
    10 2018 1 2018  1  3.27 21 4 1 1 2.356055974960327
     5 2018 0 2018  3  3.16 21 4 1 1 2.356055974960327
    24 2018 0 2013 12  3.26 45 4 1 1 2.356055974960327
    46 2018 1 2015  1     3 33 3 1 1 2.356055974960327
     2 2018 0 2014 12   3.4 25 4 1 1 2.356055974960327
    24 2018 1 2015  5   2.9 36 5 1 1 2.356055974960327
    20 2018 0 2016  6   3.7 31 2 1 1 2.356055974960327
    22 2018 0 2016 12  3.25 33 5 1 1 2.356055974960327
     3 2018 0 2018  8   2.5 33 5 1 1 2.356055974960327
     6 2018 0 2015 11   3.7 29 5 1 1 2.356055974960327
     4 2018 1 2015 11  2.68 25 4 1 1 2.356055974960327
    24 2018 1 2013 11   3.3 38 3 1 1 2.356055974960327
    18 2018 0 2015 10   4.2 29 4 1 1 2.356055974960327
     5 2018 1 2018  4   3.5 25 4 1 1 2.356055974960327
     5 2018 0 2017  9  3.75 24 4 1 1 2.356055974960327
     1 2018 1 2018 10   3.7 30 3 1 1 2.356055974960327
    12 2018 0 2015  1     . 28 2 1 1 2.356055974960327
    24 2018 0 2015  5   3.6 35 5 1 1 2.356055974960327
    11 2018 1 2015 11   3.8 29 3 1 1 2.356055974960327
     8 2018 1 2018  2  3.65 31 3 1 1 2.356055974960327
    20 2018 0 2017  2     . 24 1 1 1 2.356055974960327
    24 2018 1 2013 12   2.9 30 5 1 1 2.356055974960327
     6 2018 1 2018  5   3.3 23 4 1 1 2.356055974960327
    18 2018 0 2014 10   2.7 32 3 1 1 2.356055974960327
    24 2018 1 2015  9   2.9 28 5 1 1 2.356055974960327
    26 2018 1 2016  8   3.5 26 2 1 1 2.356055974960327
    18 2018 0 2015 11  2.45 23 3 1 1 2.356055974960327
     8 2018 1 2018  2   3.5 28 3 1 1 2.356055974960327
    18 2018 0 2015  7   3.2 38 3 1 1 2.356055974960327
     2 2018 1 2016  8  2.85 21 2 1 1 2.356055974960327
    10 2018 1 2017 11   2.5 28 3 1 1 2.356055974960327
     6 2018 0 2015 12   2.3 34 3 1 1 2.356055974960327
     2 2018 1 2018  7  3.35 40 5 1 1 2.356055974960327
    18 2018 0 2017  4   2.9 35 5 1 1 2.356055974960327
    24 2018 0 2014  4  2.65 33 5 1 1 2.356055974960327
     7 2018 0 2017  1     3 37 5 1 1 2.356055974960327
     4 2018 0 2018  6   3.9 34 5 1 1 2.356055974960327
    20 2018 1 2016  6   2.5 32 2 1 1 2.356055974960327
    26 2018 0 2016  8   3.1 37 3 1 1 2.356055974960327
    24 2018 0 2014  3  3.15 38 4 1 1 2.356055974960327
     6 2018 0 2016 11  2.45 23 3 1 1 2.356055974960327
     2 2018 0 2018  7  2.65 37 4 1 1 2.356055974960327
    24 2018 1 2016  4   4.5 41 5 1 1 2.356055974960327
     1 2018 0 2018  9   3.2 37 4 1 1 2.356055974960327
     7 2018 0 2018  3   3.1 28 4 1 1 2.356055974960327
    29 2018 0 2016  5  2.98 26 3 1 1 2.356055974960327
    12 2018 0 2016  5     . 25 3 1 1 2.356055974960327
    27 2018 1 2014  1   3.2 35 5 1 1 2.356055974960327
    24 2018 1 2014  4   3.2 41 3 1 1 2.356055974960327
    24 2018 1 2016  1  3.09 25 3 1 1 2.356055974960327
    30 2018 0 2015  6   3.9 31 5 1 1 2.356055974960327
     6 2018 1 2014  8   3.5 40 5 1 1 2.356055974960327
     1 2018 0 2018 10   2.4 18 2 1 1 2.356055974960327
    end
    label values wealth_index wealth_index
    label def wealth_index 1 "Poorest", modify
    label def wealth_index 2 "Poorer", modify
    label def wealth_index 3 "Middle", modify
    label def wealth_index 4 "Rich", modify
    label def wealth_index 5 "Richest", modify
    label values rural_urban rural_urban
    label def rural_urban 1 "Urban", modify
    label def rural_urban 2 "Rural", modify
    label values region5 region5
    label def region5 1 " West", modify

  • #2
    The asdoc command, a community-contributed command not part of base Stata, in general does not support the use of weights in its subcommands such as asdoc sum.

    Comment


    • #3
      Try the new version of asdoc which can be installed from my site. Copy and paste the following line in Stata and press enter.
      Code:
      net install asdoc, from(http://fintechprofessor.com) replace
      Please note that the above line has to be copied in full. After installation of the new version, then restart Stata.
      Code:
      asdoc sum bfduration2 survey_year female child_birth_year child_birth_month ///
      birthweight mother_age wealth_index rural_urban region5 [aw=wgt]
      Click image for larger version

Name:	zCapture.PNG
Views:	1
Size:	26.3 KB
ID:	1613499




      asdocx is now available
      A more powerful and flexible version of asdoc is now available. I call it asdocx. You may like to check the details here

      https://fintechprofessor.com/asdocx


      Please do remember to cite asdoc. To cite:

      In-text citation
      Tables were created using asdoc, a Stata program written by Shah (2018).

      Bibliography
      Shah, A. (2018). ASDOC: Stata module to create high-quality tables in MS Word from Stata output. Statistical Software Components S458466, Boston College Department of Economics.
      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

      Working...
      X