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.