Chapter Contents |
Previous |
Next |

The CATMOD Procedure |

The parameters of a linear model are generally divided into
subsets that correspond to meaningful sources of variation
in the response functions. These sources, called *
effects*, can be specified in the MODEL, LOGLIN, FACTORS,
REPEATED, and CONTRAST statements. Effects can be specified
in any of the following ways:

- A main effect is a single class variable (that is, it induces classification levels): A B C.
- A crossed effect (or interaction) is two or more class variables joined by asterisks, for example: A*B A*B*C.
- A nested effect is a main effect or an interaction, followed by a parenthetical field containing a main effect or an interaction. Multiple variables within the parentheses are assumed to form a crossed effect even when the asterisk is absent. Thus, the last two effects are identical: B(A) C(A*B) A*B(C*D) A*B(C D).
- A nested-by-value effect is the same as a nested effect except that any variable in the parentheses can be followed by an equal sign and a value: B(A=1) C(A B=1) C*D(A=1 B=1) A(C='low').
- A direct effect is a variable specified in a DIRECT statement: X Y.
- Direct effects can be crossed with other effects: X*Y X*X*X X*A*B(C D=1).

model R=B A A*B C(A B);

the effect A*B is reported as B*A since B appeared before A in the statement. Also, C(A B) is interpreted as C(A*B) and is therefore reported as C(B*A).

proc catmod; model y=a b c a*b a*c b*c a*b*c; run;and

proc catmod; model y=a|b|c; run;

When you use the bar (|) notation, the right- and left-hand sides become effects, and the interaction between them becomes an effect. Multiple bars are permitted. The expressions are expanded from left to right, using rules 1 through 4 given in Searle (1971, p. 390):

- Multiple bars are evaluated left to right.
For example, A|B|C is evaluated as follows:
A | B | C {A | B} | C {A B A*B} | C A B A*B C A*C B*C A*B*C - Crossed and nested groups of variables are combined. For example, A(B) | C(D) generates A*C(B D), among other terms.
- Duplicate variables are removed. For example, A(C) | B(C) generates A*B(C C), among other terms, and the extra C is removed.
- Effects are discarded if a variable occurs on both the crossed and nested sides of an effect. For instance, A(B) | B(D E) generates A*B(B D E), but this effect is deleted.

Other examples of the bar notation are

A | C(B) | is equivalent to | A C(B) A*C(B) |

A(B) | C(B) | is equivalent to | A(B) C(B) A*C(B) |

A(B) | B(D E) | is equivalent to | A(B) B(D E) |

A | B(A) | C | is equivalent to | A B(A) C A*C B*C(A) |

A | B(A) | C@2 | is equivalent to | A B(A) C A*C |

A | B | C | D@2 | is equivalent to | A B A*B C A*C B*C D A*D B*D C*D |

For details on how the effects specified lead to a design matrix, see the "Generation of the Design Matrix" section.

Chapter Contents |
Previous |
Next |
Top |

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