P is the matrix of counts divided by the total frequency
r and c are the row and column sums of P
the D matrices are diagonal matrices of the values of r and c
C is the Burt table.
Q is the number of categorical variables
n is the number of observations
1 is a column vector of ones

Help created on 7/12/2018