Table command in Stata

April 10, 2019

In this post we’ll have a look at the table command which can be used to visualise summary statistics by tabulating variables against one another. The contents option is used to specify table cell contents.

sysuse nlsw88, clear  
table industry, contents(mean wage count wage)

Here we are tabulating industry to get an idea of how the wage variable varies across industries. As cell contents we plot the mean and the observation count per industry.

Results of Table command

In a similar fashion we can have a look how wages differ across race:

table race, content(mean wage count wage) col

Results of Table command

Here we can see that less that in this sample members of the other race have the highest wage levels.


Profile picture

Written by Johan Osterberg who lives and works in Gothenburg, Sweden as a developer specialized in e-commerce. Connect with me on Linkedin

2024 © Johan Osterberg