I'm working with a group of people who use SPSS. SPSS calculates row and column percents differently than Stata because it uses the rounded sum of weights instead of precise figure. I understand how to use the the sum of weights in the table command in Stata 17; however, row percents are not being calculated based on those rounded sum of weights seen in output. Instead they are calculated based on the precise weighted counts.
It gives the row percent for the second level at 94% (12.787/13.579). I would like to see 93% which would be 13/14, based on the rounded sum of weights. Both R and SPSS give me the 92.8% figure, but I prefer to use Stata.
* Example generated by -dataex-. For more info, type help dataex
clear
input double(Q6 Q2_3L)
1 2
1 .
3 1
. 1
. 1
3 1
1 1
1 1
. .
1 1
1 1
1 1
1 1
1 1
1 3
1 3
3 3
. 3
1 2
1 3
1 3
1 1
. 3
1 3
3 2
1 2
1 3
1 2
. 3
1 3
. 3
1 1
1 3
1 1
1 3
. 3
1 3
1 3
end
[/CODE]
I'm assuming that this might be impossible, but I thought I would reach out to see if anyone has a workaround.
It gives the row percent for the second level at 94% (12.787/13.579). I would like to see 93% which would be 13/14, based on the rounded sum of weights. Both R and SPSS give me the 92.8% figure, but I prefer to use Stata.
Code:
table (Q6) (Q2_3L) [iw=weight] if surv_yr==2020, statistic(sumw) statistic(percent, across(Q2_3L)) nformat(%9.0fc percent sumw)
clear
input double(Q6 Q2_3L)
1 2
1 .
3 1
. 1
. 1
3 1
1 1
1 1
. .
1 1
1 1
1 1
1 1
1 1
1 3
1 3
3 3
. 3
1 2
1 3
1 3
1 1
. 3
1 3
3 2
1 2
1 3
1 2
. 3
1 3
. 3
1 1
1 3
1 1
1 3
. 3
1 3
1 3
end
[/CODE]
I'm assuming that this might be impossible, but I thought I would reach out to see if anyone has a workaround.
Comment