Dr. Attaullah Shah
Keymaster
Post count: 106

You can get rid of any column or row using the capability of flexmat. See this example

* First create the full table
asdocx tab rep78 foreign, rowsort colsort replace                            
                                Tabulation  of rep78 foreign
  0 |1                                          2             3            4 
----+-----------------------------------------------------------------------------
  1 |  Repair record 1978              Car origin                            
----+-----------------------------------------------------------------------------
  2 | 1                                  Domestic       Foreign        Total 
  3 |3                                         27             3           30 
  4 |                                          90            10          100 
  5 |                                       56.25        14.286       43.478 
  6 |4                                          9             9           18 
  7 |                                          50            50          100 
  8 |                                       18.75        42.857       26.087 
  9 |5                                          2             9           11 
 10 |                                      18.182        81.818          100 
 11 |                                       4.167        42.857       15.942 
 12 |2                                          8             0            8 
 13 |                                         100             0          100 
 14 |                                      16.667             0       11.594 
 15 |1                                          2             0            2 
 16 |                                         100             0          100 
 17 |                                       4.167             0        2.899 
 18 | Total                                    48            21           69 
 19 |                                      69.565        30.435          100 
 20 |                                         100           100          100 
----------------------------------------------------------------------------------
Click to Open File:  C:\temp\MyFile.docx

* The flexmat table shows rows and columns numbers for easy identification
** drop the desired rows
. flexmat droprow, row(4,5,7,8,10,11,13,14,16,17,19,20)


   
                            Tabulation of rep78 foreign
  0 |1                                                             2                 3                     4 
----+-------------------------------------------------------------------------------------------------------
  1 |       Repair ~1978                    Car origin                                           
----+-------------------------------------------------------------------------------------------------------
  2 |                                                       Domestic           Foreign                 Total 
  3 |3                                                            27                 3                    30 
  4 |4                                                             9                 9                    18 
  5 |5                                                             2                 9                    11 
  6 |2                                                             8                 0                     8 
  7 |1                                                             2                 0                     2 
  8 |       Total                                                 48                21                    69 
------------------------------------------------------------------------------------------------------------

* Now export the results
. asdocx export