This section illustrates, by example, the wide variety of categorical data analyses that PROC CATMOD provides. For each type of analysis, a brief description of the statistical problem and the SAS statements to provide the analysis are given. For each analysis, assume that the input data set consists of a set of cell counts from a contingency table. The variable specified in the WEIGHT statement contains these counts. In all these analyses, both the dependent and independent variables are categorical.
Suppose you want to analyze the relationship between the dependent variables (r1
, r2
) and the independent variables (a
, b
). Analyze the marginal probabilities of the dependent variables, and use a main-effects model:
proc catmod; weight wt; response marginals; model r1*r2=a b; quit;
Suppose you want to analyze the nominal dependent variables (r1
, r2
, r3
) with a log-linear model. Use maximum likelihood analysis, include the main effects and the r1
*r2
interaction in the model, and obtain the predicted cell frequencies:
proc catmod; weight wt; model r1*r2*r3=_response_ / pred=freq; loglin r1|r2 r3; quit;
Suppose you want to analyze the relationship between the nominal dependent variable (r
) and the independent variables (x1
, x2
) with a logistic regression analysis. Use maximum likelihood estimation:
proc catmod; weight wt; direct x1 x2; model r=x1 x2; quit;
If x1
and x2
are continuous so that each observation has a unique value of these two variables, then it might be more appropriate to use
the LOGISTIC or GENMOD procedure. (See the section Logistic Regression.)
Suppose the dependent variables (r1
, r2
, r3
) represent the same type of measurement taken at three different times. Analyze the relationship among the dependent variables,
the repeated measurement factor (time
), and the independent variable (a
):
proc catmod; weight wt; response marginals; model r1*r2*r3=_response_|a; repeated time 3 / _response_=time; quit;
Suppose you want to investigate the relationship between the dependent variable (r
) and the independent variables (a
, b
). Analyze the mean of the dependent variable, and include all main effects and interactions in the model:
proc catmod; weight wt; response mean; model r=a|b; quit;
PROC CATMOD can analyze the relationship between the dependent variables (r1
, r2
) and the independent variables (x1
, x2
). Use a linear regression analysis to analyze the marginal probabilities of the dependent variables:
proc catmod; weight wt; direct x1 x2; response marginals; model r1*r2=x1 x2; quit;
Suppose you want to analyze the relationship between the ordinally scaled dependent variable (r
) and the independent variable (a
). Use cumulative logits to take into account the ordinal nature of the dependent variable, and use weighted least squares
estimation:
proc catmod; weight wt; response clogits; model r=_response_ a; quit;
Suppose the data set contains estimates of a vector of four functions and their covariance matrix, estimated in such a way
as to correspond to the sampling process that is used. Analyze the functions with respect to the independent variables (a
, b
), and use a main-effects model:
proc catmod; response read b1-b10; model _f_=_response_; factors a 2 , b 5 / _response_=a b; quit;