Create formatted tables in Stata [dm24: STB-23] -------------------------------- ^table^ table-subcommand [^,^ options ] Description ----------- The ^table^ command creates, prints, and drops formatted tables. These tasks are carried out by the six table subcommands: ^define^, ^number^, ^text^, ^format^, ^print^, and ^drop^. Tables along with their rows and columns are referred to by their names. The first row and column of a table comprise the stubs, and this row and column both have the reserved name "^stub^". Rows and columns are added to tables in the order in which they are named. ^table^ subcommands ----------------- ^table^ ^define^ table-name [ ^"^table-title^"^ ] defines a new table. Table names must be four characters or less. More than one table can be active at a time. ^table^ {^number^ # | ^text "^text^"^} [^,^ ^table(^table-name^)^ ^row(^row-name^)^ ^col(^column-name^)^ ^font(^color^)^ ] defines the contents of a table cell. In the ^table^ ^number^ subcommand, the "^#^" can be a numeric constant or an expression. If an expression contains spaces, it must be enclosed in quotes. Row and column names must be eight characters or less. If any of the table, row, or column names are omitted, the most-recently named table, row, or column is assumed. Allowed colors are ^yellow^ (the default for numbers), ^green^ (the default for text), ^white^, ^blue^, and ^red^. ^table^ ^format^ display-format [^,^ ^table(^table-name^)^ ^row(^row-name^)^ ^col(^column-name^)^ ^font(^color^)^ ] specifies the display format of cell entries. If only a row name or column name is specified, the display format is applied to the entire row or column. Any Stata display format can be used. ^table^ ^print^ [^,^ ^table(^table-name^)^ ] prints a table. ^table^ ^drop^ table-name drops a table. NOTE: There must be a space on both sides of the "^,^" when options are specified. Example ------- ^.^ ^table^ ^define^ ^A^ ^"Example^ ^Table"^ ^.^ ^table^ ^text^ ^"^ ^"^ ^,^ ^row(stub)^ ^col(stub)^ ^.^ ^table^ ^text^ ^"Column^ ^1"^ ^,^ ^row(stub)^ ^col(one)^ ^.^ ^table^ ^text^ ^"Column^ ^2"^ ^,^ ^row(stub)^ ^col(two)^ ^.^ ^table^ ^text^ ^"Row^ ^A"^ ^,^ ^row(a)^ ^col(stub)^ ^.^ ^table^ ^text^ ^"Row^ ^B"^ ^,^ ^row(b)^ ^col(stub)^ ^.^ ^table^ ^number^ ^1^ ^,^ ^row(a)^ ^col(one)^ ^.^ ^table^ ^number^ ^2^ ^,^ ^row(a)^ ^col(two)^ ^.^ ^table^ ^number^ ^3^ ^,^ ^row(b)^ ^col(one)^ ^.^ ^table^ ^number^ ^4^ ^,^ ^row(b)^ ^col(two)^ ^.^ ^table^ ^print^ ^,^ ^table(A)^ ^Example^ ^Table^ ^Column^ ^1^ ^Column^ ^2^ ^Row^ ^A^ ^1^ ^2^ ^Row^ ^B^ ^3^ ^4^ Author ------ William H. Rogers, Stata Corporation FAX 409-696-4601 Also see -------- STB: dm24 (STB-23)