Announcement

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

  • Exporting missing values with tabout (mi)

    Hi all,

    I need to create a demographics table and it will have quite a lot of missing data. Tabout version 3 has an option to export the missing data (mi), but when I try to do this, no error occurs but the missing values for each variable are not exported.

    As a simple example:

    . tabout sex agegroup1 studygp using Demographics_08Sep.xls, replace c(freq col) mi

    Table output written to: Demographics_08Sep.xls



    Can anyone explain why the missing option is not working?

    Thanks!

  • #2
    The tabout v3 missing option works for basic tables but not for summary tables. You need to use "plugging". See the tabout v3 user manual http://tabout.net.au/downloads/tabout_user_guide.pdf , section "7.2. Plugging gaps in tables" on pages 55-63.

    Comment


    • #3
      Originally posted by Anders Alexandersson View Post
      The tabout v3 missing option works for basic tables but not for summary tables. You need to use "plugging". See the tabout v3 user manual http://tabout.net.au/downloads/tabout_user_guide.pdf , section "7.2. Plugging gaps in tables" on pages 55-63.
      Thank you for the response! I was trying to use the basic table as I require both counts and percentage, and the other options didn't look like they would work.

      For example, an output I would like is:

      Var n %
      Sex
      Male 10 10
      Female 80 80
      Missing 10 10

      The plugging gaps looked like it was for when values shouldn't be present...

      Comment


      • #4

        Ian Watson: On closer look, I can reproduce the problem that Monica reported with the mi option not working in the user-written tabout version 3:

        Code:
        . sysuse auto, clear
        (1978 Automobile Data)
        
        . tabulate rep78, mi
        
             Repair |
        Record 1978 |      Freq.     Percent        Cum.
        ------------+-----------------------------------
                  1 |          2        2.70        2.70
                  2 |          8       10.81       13.51
                  3 |         30       40.54       54.05
                  4 |         18       24.32       78.38
                  5 |         11       14.86       93.24
                  . |          5        6.76      100.00
        ------------+-----------------------------------
              Total |         74      100.00
        
        . tabout rep78 using test, c(freq col) replace mi
        
        Table output written to: test
        
        
                No.     %
        Repair Record 1978
        1       2.0     2.9
        2       8.0     11.6
        3       30.0    43.5
        4       18.0    26.1
        5       11.0    15.9
        Total   69.0    100.0
        
        . which tabout
        c:\ado\personal\tabout.ado
        *! Version 3.0.3 beta Ian Watson 8may2017
        *! Stata 14.2 (or later) version

        Comment


        • #5
          Hello! Has there been any follow-up to this issue? Ian Watson

          Comment


          • #6
            While Ian Watson replies to this, you can try asdoc for reporting missing values.
            Code:
            ssc install asdoc
            sysuse auto, clear
            asdoc tabulate rep78, missing replace
            Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	23.8 KB
ID:	1592628

            more on asdoc can be found here https://fintechprofessor.com/2018/01/31/asdoc/
            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