First and foremost, thank you in advance to anybody that is able to help out. I tried searching Statalist and Google for a solution or something that could point me in the right direction but I have had no luck. Now to the issue.
Version information: Stata version 15, current update level is 21 Mar 2019; tabout version 3
Data background: This is a single year survey that has been weighted using the -svy- command. I cannot upload it or portions of it due to contractual and data sensitivity reasons.
Issue: I am attempting to produce survey weighted cross tabulation tables which contains an outcome variable (on top of table) by 6 cross variables (rows). For some of the cross variables, none of the respondents selected a response option, but for the other cross variables they have selected all options so there are no missing data. This may be hard to visualize so I will create a fake data table below to visually show what is occurring. The -tabout- has an option of -show(all)- that should fix this issue, but is not; Stata also returns an error stating to use this option that I'm already using, but it appears to not be processing this option since it's already apart of my code. I have also tried including the -mi- option, but this doesn't work either. I have referenced the manual and I have not had any luck.
My code
Code:
foreach var of varlist been_homeless { 2. . quietly tabout age_cat female race_eth fpl region any_chronic `var' using `var'.tex, /// > show(all) cells(row) format(1) clab(Row%) /// > svy percent stats(chi2) npos(lab) ptotal(single) replace /// > style(tex) bt font(bold) topstr(18cm) topf(top.tex) botf(bot_Sweave.tex) 3. }
Error received
Code:
Warning: not all panels have the same number of columns. Include show(all) in your syntax to view panels.
Table 1. Fake Table (Row %) - These %s are actual %s
Homeless | in | past | 3 | years | ||||
Yes | No | Don't know | Refused | Total | ||||
Age | ||||||||
19-35 | 20% | 60% | 2% | 18% | 100% | |||
36-49 | 5% | 84% | 0% | 1% | 100% | |||
50-64 | 1% | 95% | 2% | 1% | 100% | |||
Gender | ||||||||
Male | 34% | 66% | 0% | 100% | ||||
Female | 34% | 66% | 0% | 100% | ||||
As one can see, the 'Refused' column shows the percentages for the 'Total' column instead of displaying 0s or being blank. When I run the code within Stata not outputting tables using -tabout-, it executes how it should. Any help trying to identify the mechanism that is causing this behavior, or a work around would be greatly appreciated.
I apologize if I did not include something that I should have. Thank you again and I hope you have a great day!
0 Response to -tabout- -show(all)- and -mi- not working
Post a Comment