In reply to Ian Wakeling.

Yes, missing values alway complicate matrix computations.

I belive that the DESIGN function already supports the "missing category" and adds an additional column (the first column) to the design matrix. The existing TABULATE CALL is valid for one-way tabulations. With work, you can write a module that extends TABULATE to two-way tables, but it should be easier. Your trick of using the cross-product of the design matrices is simpler.