Announcement

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

  • Asdoc not applying weights in pwcorr

    I've been using asdoc to create a word document. I have several frequency and correlation tables that I want to create with survey data. When I use the tab command, asdoc applies the weights as specified. However, if I use to tab1 to create many frequency tables or I do a pwcorr asdoc does not apply the weights.

    For example:

    Code:
    asdoc tab1 Q1A [iw=weight] if surv_yr == 2020, save(EG_tbl_new) append​​​​​​​
    This is the unweighted output with the asdoc tab1 command.

    Tabulation of Q1A
    Q1A: Initial information the IRS provided so you knew what to expect Freq. Percent Cum.
    1: Very Dissatisfied 34 8.13 8.13
    2: Somewhat Dissatisfied 34 8.13 16.27
    3: Neither Satisfied Nor Dissatisfied 53 12.68 28.95
    4: Somewhat Satisfied 94 22.49 51.44
    5: Very Satisfied 203 48.56 100.00
    Total 418 100.00

    That is the weighted output with the asdoc tab command.
    ​​​​​​​
    Code:
    asdoc tab Q1A [iw=weight] if surv_yr == 2020, save(EG_tbl_new) append​​​​​​​

    Tabulation of Q1A
    Q1A: Initial information the IRS provided so you knew what to expect Freq. Percent Cum.
    1: Very Dissatisfied 34.775 8.36 8.36
    2: Somewhat Dissatisfied 38.532 9.27 17.63
    3: Neither Satisfied Nor Dissatisfied 53.079 12.76 30.39
    4: Somewhat Satisfied 94.769 22.79 53.18
    5: Very Satisfied 194.669 46.82 100.00
    Total 416 100.00

    I know I can run a loop with asdoc and the tab command with all my variables which I will do now. However, I do need to run the pwcorr, which also doesn't apply weights with asdoc. Does anyone know a solution to this? Is this a bug?


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input double(Q1A Q1B Q1C Q1D)
     4  3  .  5
     2  2  1  2
     3  2  2  1
     4  3  3  1
     2  3  1  2
     3  3  3  2
     .  .  .  .
     1  1  1  1
     4  4  3  2
     1  1  1  1
     1  1  .  2
     5  5  5  5
     1  1  1  1
     1  1  1  1
     4  3  3  4
     4  3  3  4
     5  3  3  5
     3  5  5  5
     4  2  2  2
     5  3  5  5
     4  4 98  4
     5  1  3  5
     5 98  5  5
     5  5  5  5
     4 98  5  5
     2  3  3  2
     5  4  4  5
     3  3  3  3
     5  4  5  5
     2  3  1  4
     5  2  3  4
     3  2  2  4
     5  3  3  5
     3  2  1  2
    end
    Above is a working short example of some data.

    Thank you.



  • #2
    Hello john dattoma
    Welcome to Statalist. As reported by you, the pwcorr command in asdoc does not support weights. I have added it to the my future plans for asdocx. In the last update of the asdoc, I stated the following in its help file:

    It is now almost three years that I have been developing asdoc and constantly adding features to it. With the addition of _docx and xl() classes to Stata, it is high time to add support for native docx and xlsx output to asdoc. Also, given that there exists a significant number of LaTeX users, asdoc should be able to create LaTeX documents. It gives me immense pleasure to announce asdocx that is not only more flexible in making customized tables, but also creates documents in native docx, xlsx, html, and .tex formats. If you have enjoyed and find asdoc useful, please consider buying a copy of asdocx to support its development. Details related to asdocx can be found on this page https://fintechprofessor.com/asdocx/
    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
      Hi Attaullah Shah,
      Thanks for the great tool. That is very good to know. I assume tab1 also does not support weights, because I have the same issue. Unfortunately, I use Stata on a server that gives me very limited authorization to download outside packages or I certainly would download this. I will run it up the ranks, however.

      Thanks,
      John
      Last edited by john dattoma; 05 Nov 2021, 14:21.

      Comment


      • #4
        I think if you place the asdocx files on your computer, it should work. asdocx does not need to be installed on the server.
        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