Thanks to Kit Baum a new package, stdtable, is now available from SSC. It can be installed by typing in Stata ssc install stdtable.
stdtable standardizes a cross tabulation such that the marginal distributions (row and column totals) correspond to some pre-specified distribution, a technique that goes back to at least (Yule 1912). The purpose is to display the association that exists in the table nett of the marginal distributions. Consider the example below:
There are many more people that went from a farm to lower manual than the other way around. However, the number of people in agriculture strongly declined so sons had to leave the farm. Moreover, the number of people in lower manual occupations were on the increase, offering room for those sons that had to leave their farm. We may be interested in knowing if this asymmetry is completely explained by these changes in the marginal distribution, or if there is more to it.
These standardized counts can be interpreted as the row and column percentages that would occur if for both fathers and sons each occupation was equally likely. It appears that the apparent asymmetry was almost entirely due to changes in the marginal distributions. Also, it is now much clearer that farming is much more persistent over generations than the other occupations.
Standardizing cross-tabulations also help when comparing tables across groups. In the example below we look at the race of husbands and wives in the USA for married couples whose husbands were born born between 1821 and 1989. We can see that the racial boundaries have become a bit more permeable over time, but that the USA is still very far removed from being a melting pot. In this example I also use Nick Cox's tabplot, which is also available from SSC, to graph the results

Yule, U. (1912) On the methods of measuring association between two attributes, Journal of the Royal Statistical Society, 75(6):579-652.
stdtable standardizes a cross tabulation such that the marginal distributions (row and column totals) correspond to some pre-specified distribution, a technique that goes back to at least (Yule 1912). The purpose is to display the association that exists in the table nett of the marginal distributions. Consider the example below:
Code:
use "http://www.maartenbuis.nl/software/mob.dta", clear (mobility table from the USA collected in 1973) tab row col [fw=pop] Father's | Son's occupation occupation | upper non lower non upper man lower man farm | Total ----------------+-------------------------------------------------------+---------- upper nonmanual | 1,414 521 302 643 40 | 2,920 lower nonmanual | 724 524 254 703 48 | 2,253 upper manual | 798 648 856 1,676 108 | 4,086 lower manual | 756 914 771 3,325 237 | 6,003 farm | 409 357 441 1,611 1,832 | 4,650 ----------------+-------------------------------------------------------+---------- Total | 4,101 2,964 2,624 7,958 2,265 | 19,912
Code:
stdtable row col [fw=pop], cellwidth(9) ----------------------------------------------------------------------------- Father's | Son's occupation occupation | upper non lower non upper man lower man farm Total ----------------+------------------------------------------------------------ upper nonmanual | 41.7 23.6 17.3 13.1 4.23 100 lower nonmanual | 27 30 18.4 18.1 6.42 100 upper manual | 15.9 19.9 33.2 23.2 7.73 100 lower manual | 11.1 20.6 22 33.8 12.5 100 farm | 4.3 5.78 9.03 11.7 69.1 100 | Total | 100 100 100 100 100 500 -----------------------------------------------------------------------------
Standardizing cross-tabulations also help when comparing tables across groups. In the example below we look at the race of husbands and wives in the USA for married couples whose husbands were born born between 1821 and 1989. We can see that the racial boundaries have become a bit more permeable over time, but that the USA is still very far removed from being a melting pot. In this example I also use Nick Cox's tabplot, which is also available from SSC, to graph the results
Code:
. use "http://www.maartenbuis.nl/software/interracial.dta", clear (husband's and wife's race in the USA from the census and ACS 1880-2014) . qui stdtable hrace wrace [fw=_freq], by(coh) replace . tabplot hrace coh [iw=std], /// > by(wrace, compact cols(3) note("")) /// > xtitle("husband's birth cohort" "wife's race") /// > xlab(1(2)18,angle(35) labsize(vsmall))
Yule, U. (1912) On the methods of measuring association between two attributes, Journal of the Royal Statistical Society, 75(6):579-652.
Comment