help for rc2                                                     John Hendrickx

Goodman's row and column model 2


rc2 varlist [if exp] [in range] [weight] , row(varname) colvarname) [ muby(varlist) muby3(string) eq norm niter(#) rctol(# ) debug


rc2 estimates Goodman's log-multiplicative Row and Columns model 2.This model is a variation on a regular loglinear model. A sigma scale is estimated for the row variable, a phi scale is estimated for the column variable, and a mu parameter indicates the scaled association between the two variables.


row the row variable (required)

col the column variable (required)

muby a list of factors by which the mu parameter will vary

muby3 specify an interaction between the mu parameter and other variables using the xi3 command. The xi3 command must be installed first; xi3 is available from the ssc archives. muby3 must specify the dummies that are to interact with mu using valid xi3 syntax, e.g. muby3("e.groupvar") The muby option is ignored if muyb3 is used.

eq specifies an equality constraint on sigma and phi. This option requires that the row and column variable both have the same number of categories. The default is noeq.

norm The option nonorm suppresses printing of the normalized phi and sigma scales (mean 0, sum of squares 1). The default is norm.

niter specifies the maximum number of iterations for estimating the model. The default is 20.

rctol specifies the convergence criterion for estimating the model. The default is .0001.

debug prints intermediate results to assist in debugging. The default is nodebug.


You must estimate a baseline loglinear model using either poisson or glm with a log link and the poission family before running rc2. Usually the baseline model will be either an independence model or a quasi- independence model. The dummies in the baseline model can be created using xi, xi3, desmat or any other method.

Goodman's rc2 model has the following form:

log(F[ij]) = <baseline model> + sigma[i]*mu*phi[j]

Where F[ij] indicates the expected frequencies of the model, i indexes the categories of the row variable, and j indexes the categories of the column variable. sigma[i] indicates the estimated scale values for the row variable, phi[j] indicates the estimated scale values for the column variable. mu indicates the scaled association between the row and column variable.

Two values of sigma[i] and phi[j] must be fixed to identify the model. rc2 fixes the first category to 0 and the highest category to 1 while estimating the model. For the final model, the sigma and phi scales are also reported using the restriction that they sum to 0 and have a sum of squares of 1. Printing of these normalized scale values can be suppressed using the nonorm option.

The rc2 model contains both linear and multiplicative parameters. Therefore, it cannot be estimated in a straightforward fashion. However, given scale values for sigma, the model simplifies to a regular loglinear model and values for mu*phi[j] can be estimated. Likewise, given scale values for phi, values for mu*sigma[i] can be estimated.

rc2 estimates the model in this fashion, taking sigma as given and estimating phi, then taking the updated values of phi as given and estimating sigma. This continues until the improvement in fit between subsequent loglinear models is less than rctol (default .0001) or the number of iterations exceeds niter (default 10).

Note that due to the estimation procedure used, the standard errors for coefficients are conditional on the sigma and phi scale values. In addition, the degrees of freedom reported by poisson are not correct, since they do not take the estimated sigma and phi coefficients into account. Refer to the Model summary at the end of the output for the correct degrees of freedom and other goodness of fit statistics.


This example is taken from Hout (1983: 56-65).

/* Table in Hout (1983: 11). Original source: page 49 of */ /* Featherman D.L., R.M. Hauser. (1978) "Opportunity and Change." */ /* New York: Academic. */ #delimit ; tabi 1414 521 302 643 40 \ 724 524 254 703 48 \ 798 648 856 1676 108 \ 756 914 771 3325 237 \ 409 357 441 1611 1832 ,replace; #delimit cr

rename row father rename col son rename pop freq

label var father "Father's occupation" label var son "Son's occupation" #delimit ; label def occ 1 "Upper nonmanual" 2 "Lower nonmanual" 3 "Upper manual" 4 "Lower manual" 5 "Farm"; #delimit cr label val father occ label val son occ

xi: glm freq i.father i.son, family(poisson) link(log) rc2 , row(father) col(son) rc2 , row(father) col(son) eq

gen diag=(father==son)*father xi: poisson freq i.father i.son i.diag rc2 , row(father) col(son) rc2 , row(father) col(son) eq


The rc2 model can also be estimated as a multinomial logistic regression model using mclest. The mcl package is available from the ssc archives.

mclest will be somewhat faster than rc2 for large tables because it does not have to estimate the main effects of the row variable or interactions of the row variable with group variables. If these effects are not of interest, then mclest could be used instead of rc2. Note that mclest also works for non-aggregated data. The example above can be estimated with mclest as follows:

mclgen son xi: mclest i.son [fw=freq],rc2(father) xi: mclest i.son [fw=freq],eqrc2(father) gen diag=(father==son)*father xi: mclest i.son i.diag [fw=freq],rc2(father) xi: mclest i.son i.diag [fw=freq],eqrc2(father)

The unidiff program by Maurizio Pisati, University of Trento, Italy, can estimate uniform layer effect models. Use findit unidiff to obtain the program.

LEM is a standalone program for Windows computers by Jeroen Vermunt, Tilburg University, the Netherlands. LEM is a fast and flexible tool for estimating rc2 models (as well as latent class and a wide array of other models). LEM is available at http://www.uvt.nl/faculteiten/fsw/organisatie/departementen/mto/software2.html

Saved results

In addition to the results saved by poisson, rc2 saves the following matrices:

e(sig) the sigma scale with the first category fixed to 0, the last to 1

e(phi) the phi scale with the first category fixed to 0, the last to 1

e(sig_n) the sigma scale with mean 0 and sum of squares 1

e(phi_n) the phi scale with mean 0 and sum of squares 1

e(df_m) the model degrees of freedom adjusted for the sigma and phi parameters

e(deviance) the deviance as calculated by poisgof

e(df) the residual degrees of freedom, also adjusted for the sigma and phi parameters

e(ll_b) the log likelihood of the baseline model

e(df_b) the model degrees of freedom of the baseline model

e(model) "rc2" or "eqrc2", depending on the eq option

e(b) and e(V) contain the estimates and variance- covariance for the normalized solution, unless the nonorm option was used. The values for the model using the zero-one constraints can be obtained using "estimates unhold c0_1".

rc2 defines the following global macros that persist between runs of rc2:

$RC_depvar The dependent variable of the baseline model

$RC_base The independent variables of the baseline model


Goodman, Leo A. (1979). Multiplicative models for the analysis of occupational mobility tables and other kinds of cross-classification tables. American Journal of Sociology 84: 804-819.

Goodman, Leo A. (1984). The analysis of cross-classified data having ordered categories. Cambridge, Mass.: Harvard University Press.

Hout, Michael. (1983). Mobility Tables. Sage Publication 07-031.

Xie, Yu (2003). Association Model. In the Encyclopedia of Social Science Research Methods, edited by Michael Lewis-Beck, Alan Bryman and Tim Futing Liao. Thousand Oaks, Ca: Sage (2003).


Also see

Direct comments to: John Hendrickx

rc2 is available from the ssc archives. Use findit rc2 to locate the latest version.

The packages mcl, desmat, xi3, are also available from the ssc archives. Use findit unidiff to obtain unidiff.

On-line: help for poisson, poisgof, glm, mclgen, mclest, unidiff, desmat, desrep, xi, xi3