Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The CATMOD Procedure

RESPONSE Statement

RESPONSE < function >< / options > ;
The RESPONSE statement specifies functions of the response probabilities. The procedure models these response functions as linear combinations of the parameters.

By default, PROC CATMOD uses the standard response functions (generalized logits, which are explained in detail in the "Understanding the Standard Response Functions" section). With these standard response functions, the default estimation method is maximum likelihood, but you can use the WLS option in the MODEL statement to request weighted least-squares estimation. With other response functions (specified in the RESPONSE statement), the default (and only) estimation method is weighted least squares.

You can specify more than one RESPONSE statement, in which case each RESPONSE statement produces a separate analysis. If the computed response functions for any population are linearly dependent (yielding a singular covariance matrix), then PROC CATMOD displays an error message and stops processing. See the "Cautions" section for methods of dealing with this.

The function specification can be any of the items in the following list. For an example of response functions generated and formulas for q (the number of response functions), see the "More on Response Functions" section.

ALOGIT
ALOGITS
specifies response functions as adjacent-category logits of the marginal probabilities for each of the dependent variables. For each dependent variable, the response functions are a set of linearly independent adjacent-category logits, obtained by taking the logarithms of the ratios of two probabilities. The denominator of the kth ratio is the marginal probability corresponding to the kth level of the variable, and the numerator is the marginal probability corresponding to the (k+1)th level. If a dependent variable has two levels, then the adjacent-category logit is the negative of the generalized logit.
CLOGIT
CLOGITS
specifies that the response functions are cumulative logits of the marginal probabilities for each of the dependent variables. For each dependent variable, the response functions are a set of linearly independent cumulative logits, obtained by taking the logarithms of the ratios of two probabilities. The denominator of the kth ratio is the cumulative probability, ck, corresponding to the kth level of the variable, and the numerator is 1-ck (Agresti 1984, 113 -114). If a dependent variable has two levels, then PROC CATMOD computes its cumulative logit as the negative of its generalized logit. You should use cumulative logits only when the dependent variables are ordinally scaled.
JOINTspecifies that the response functions are the joint response probabilities. A linearly independent set is created by deleting the last response probability. For the case of one dependent variable, the JOINT and MARGINALS specifications are equivalent.
LOGIT
LOGITS
specifies that the response functions are generalized logits of the marginal probabilities for each of the dependent variables. For each dependent variable, the response functions are a set of linearly independent generalized logits, obtained by taking the logarithms of the ratios of two probabilities. The denominator of each ratio is the marginal probability corresponding to the last observed level of the variable, and the numerators are the marginal probabilities corresponding to each of the other levels. If there is one dependent variable, then specifying LOGIT is equivalent to using the standard response functions.
MARGINAL
MARGINALS
specifies that the response functions are marginal probabilities for each of the dependent variables in the MODEL statement. For each dependent variable, the response functions are a set of linearly independent marginals, obtained by deleting the marginal probability corresponding to the last level.
MEAN
MEANS
specifies that the response functions are the means of the dependent variables in the MODEL statement. This specification requires that all of the dependent variables be numeric.
READ variablesspecifies that the response functions and their covariance matrix are to be read directly from the input data set with one response function for each variable named. See the section "Inputting Response Functions and Covariances Directly" for more information.
transformationspecifies response functions that can be expressed by using successive applications of the four operations: LOG, EXP, * matrix literal, or + matrix literal. The operations are described in detail in the "Using a Transformation to Specify Response Functions" section.


You can specify the following options in the RESPONSE statement after a slash.

OUT=SAS-data-set
produces a SAS data set that contains, for each population, the observed and predicted values of the response functions, their standard errors, and the residuals. Moreover, if you use the standard response functions, the data set also includes observed and predicted values of the cell frequencies or the cell probabilities. For further information, see the "Output Data Sets" section.

OUTEST=SAS-data-set
produces a SAS data set that contains the estimated parameter vector and its estimated covariance matrix. For further information, see the "Output Data Sets" section.

TITLE='title'
displays the title at the top of certain pages of output that correspond to this RESPONSE statement.

More on Response Functions

Suppose the dependent variable A has 3 levels and is the only response-effect in the MODEL statement. The following table shows the proportions upon which the response functions are defined.

Value of A:123
proportions:p1p2p3


Note that \sum_j p_j = 1. The following table shows the response functions generated for each population.

Function Value  
Specification of q Response Function
none*2ln( [(p1)/(p3)] ),   ln( [(p2)/(p3)] )
ALOGITS2ln( [(p2)/(p1)] ),   ln( [(p3)/(p2)] )
CLOGITS2ln( [(1-p1)/(p1)] ),   ln( [(1-(p1+p2))/(p1+p2)] )
JOINT2p1,   p2
LOGITS2ln( [(p1)/(p3)] ),   ln( [(p2)/(p3)] )
MARGINAL2p1,   p2
MEAN11 p1 + 2 p2 + 3 p3
*Without a function specification, the default response
functions are generalized logits.


Now, suppose the dependent variables A and B each have 3 levels (valued 1, 2, and 3 each) and the response-effect in the MODEL statement is A*B. The following table shows the proportions upon which the response functions are defined.

Value of A:111222333
Value of B:123123123
proportions:p1p2p3p4p5p6p7p8p9


The marginal totals for the preceding table are defined as follows,
rcl}
p_{1 \cdot} & = & p_1 + p_2 + p_3 & & 
p_{\cdot 1} & = & p_1 + p_4 + p_7 \ ...
 ... \  
p_{3 \cdot} & = & p_7 + p_8 + p_9 & & 
p_{\cdot 3} & = & p_3 + p_6 + p_9 \
where \sum_j p_j = 1.The following table shows the response functions generated for each population.

Function Value  
Specification of q Response Function
none*8ln( [(p1)/(p9)] ),   ln( [(p2)/(p9)] ),   ln( [(p3)/(p9)] ), ... ,   ln( [(p8)/(p9)] )
ALOGITS4ln( [(p2 ·)/(p1 ·)] ),   ln( [(p3 ·)/(p2 ·)] ),   ln( [(p·2)/(p·1)] ),   ln( [(p·3)/(p·2)] )
CLOGITS4ln( [(1-p1 ·)/(p1 ·)] ),   ln( [(1-(p1 ·+p2 ·))/(p1 ·+p2 ·)] ),   ln( [(1-p·1)/(p·1)] ),   ln( [(1-(p·1+p·2))/(p·1+p·2)] )
JOINT8p1,   p2,   p3,   p4,   p5,   p6,   p7,   p8
LOGITS4ln( [(p1 ·)/(p3 ·)] ),   ln( [(p2 ·)/(p3 ·)] ),   ln( [(p·1)/(p·3)] ),   ln( [(p·2)/(p·3)] )
MARGINAL4p1 ·,   p2 ·,   p·1,   p·2
MEAN21 p1 · + 2 p2 · + 3 p3 ·,   1 p·1 + 2 p·2 + 3 p·3
* Without a function specification, the default response functions are generalized logits.


The READ and transformation function specifications are not shown in the preceding table. For these two situations, there is not a general response function; the response functions generated depend on what you specify.

Another important aspect of the function specification is the number of response functions generated per population, q. Let mi represent the number of levels for the ith dependent variable in the MODEL statement, and let d represent the number of dependent variables in the MODEL statement. Then, if the function specification is ALOGITS, CLOGITS, LOGITS, or MARGINALS, the number of response functions is
q = \sum_{i=1}^d (m_i - 1)
If the function specification is JOINT or the default (generalized logits), the number of response functions per population is
q = r - 1
where r is the number of response profiles. If every possible cross-classification of the dependent variables is observed in the samples, then
r = \prod_{i=1}^d m_i
Otherwise, r is the number of cross-classifications actually observed.

If the function specification is MEANS, the number of response functions per population is q=d.

Response Statement Examples

Some example response statements are shown in the following table.

Example Result
response marginals;marginals for each dependent variable
response means;the mean of each dependent variable
response logits;generalized logits of the marginal probabilities
response clogits;cumulative logits of the marginal probabilities
response alogits;adjacent-category logits of the marginal probabilities
response joint;the joint probabilities
response 1 -1 log;the logit
response;generalized logits
response 1 2 3;the mean score, with scores of 1, 2, and 3 corresponding to the three response levels
response read b1-b4;four response functions and their covariance matrix, read directly from the input data set


Using a Transformation to Specify Response Functions

If you specify a transformation, it is applied to the vector that contains the sample proportions in each population. The transformation can be any combination of the following four operations.

Operation Specification
linear combination* matrix literal
 matrix literal
logarithmLOG
exponentialEXP
adding constant+ matrix literal


If more than one operation is specified, then PROC CATMOD applies the operations consecutively from right to left.

A matrix literal is a matrix of numbers with each row of the matrix separated from the next by a comma. If you specify a linear combination, in most cases the * is not needed. The following statement defines the response function p1+1. The * is needed to separate the two matrix literals '1' and '1 0'.

   response + 1 * 1 0;


The LOG of a vector transforms each element of the vector into its natural logarithm; the EXP of a vector transforms each element into its exponential function (antilogarithm).

In order to specify a linear response function for data that have r=3 response categories, you could specify either of the following RESPONSE statements:

   response  * 1 0 0 , 0 1 0;
   response    1 0 0 , 0 1 0;


The matrix literal in the preceding statements specifies a 2 ×3 matrix, which is applied to each population as follows:
[ F_1 \ F_2 ] =
[ 1 & 0 & 0 \ 0 & 1 & 0 
 ] *
[ p_1 \ p_2 \ p_3 ]
where p1, p2, and p3 are sample proportions for the three response categories in a population, and F1 and F2 are the two response functions computed for that population. This response function, therefore, sets F1=p1 and F2=p2 in each population.

As another example of the linear response function, suppose you have two dependent variables corresponding to two observers who evaluate the same subjects. If the observers grade on the same three-point scale and if all nine possible responses are observed, then the following RESPONSE statement would compute the probability that the observers agree on their assessments:

   response 1 0 0 0 1 0 0 0 1;


This response function is then computed as

F = p_{11} + p_{22} + p_{33} = 
[ 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \ ] *
[ p_{11} \ p_{12} \ p_{13} \ 
 p_{21} \ p_{22} \ p_{23} \ 
 p_{31} \ p_{32} \ p_{33} \ ]
where pij denotes the probability that a subject gets a grade of i from the first observer and j from the second observer.

If the function is a compound function, requiring more than one operation to specify it, then the operations should be listed so that the first operation to be applied is on the right and the last operation to be applied is on the left. For example, if there are two response levels, the response function

   response 1 -1 log;


is equivalent to the matrix expression:
F = [ 1 & -1 \ ] *
 [ \log(p_1) \ \log(p_2) \ 
 ]
 = \log(p_1)-\log(p_2) = \log(\frac{p_1}{p_2})
which is the logit response function since p2=1-p1 when there are only two response levels.

Another example of a compound response function is
   response exp 1 -1 * 1 0 0 1, 0 1 1 0 log;
which is equivalent to the matrix expression
F = EXP(A*B*LOG(P))
where P is the vector of sample proportions for some population,
A = [ 1 & -1 \ ]
{ and } 
B = [ 1 & 0 & 0 & 1 \ 0 & 1 & 1 & 0 \ ]

If the four responses are based on two dependent variables, each with two levels, then the function can also be written as

F = [(p11p22)/(p12p21)]

which is the odds (crossproduct) ratio for a 2 ×2 table.

Understanding the Standard Response Functions

If no RESPONSE statement is specified, PROC CATMOD computes the standard response functions, which contrast the log of each response probability with the log of the probability for the last response category. If there are r response categories, then there are r-1 standard response functions. For example, if there are four response categories, using no RESPONSE statement is equivalent to specifying

   response  1 0 0 -1,
             0 1 0 -1,
             0 0 1 -1  log;
This results in three response functions:
F = [ F_1 \ F_2 \ F_3 \ ] =
 [ \log(p_1/p_4) \ \log(p_2/p_4) \ \log(p_3/p_4) \ ]
If there are only two response levels, the resulting response function would be a logit. Thus, the standard response functions are called generalized logits. They are useful in dealing with the log-linear model:
{\pi} = {EXP}(X {\beta})
If C denotes the matrix in the preceding RESPONSE statement, then because of the restriction that the probabilities sum to 1, it follows that an equivalent model is
C * {LOG}({\pi}) = ({CX}) {\beta}
But C*LOG(P) is simply the vector of standard response functions. Thus, fitting a log-linear model on the cell probabilities is equivalent to fitting a linear model on the generalized logits.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.