tab1 tab2 and tab commands

tab1 tab2 and tab commands

by Laura Koth -
Number of replies: 1

Hi everyone,

the stata manual describes functions for commands tab1 and tab2 differently.

I seem to get the same out put if I just use "tab" and one or two var, respectively.

is it necessary to designate "tab1" for one-way tables and "tab2" for two-way tables?

In reply to Laura Koth

Re: tab1 tab2 and tab commands

by Eduardo Rodriguez Almaraz -

Hello Laura,

The difference between this three commands is the tables that STATA returns for you.  'tab1' and 'tab2' are used in case you want to produce several tables with one command.

If you specify 'tab1' and list, say 3 variables (sex, heartatk and diabetes) STATA will return 1 one-way table for each variable.

If you use the 'tab2' command with the same variables it will display 3 two-way tables (diabetes by sex, heartatk by diabetes, and heartk by sex).

If you use the 'tab' command, you can only use up to 2 variables because it displays 1 table at the time.

And of course, the options that you can use with each command are different.

Hopefully this was clear and helpful.