/*---------------------------------------------------*/ /* */ /* Behavior of Squirrel Monkeys */ /* ---------------------------- */ /* In a population of 6 squirrel monkeys, the joint distribution */ /* of genital display with respect to (active role, passive role) */ /* was observed. Since a monkey cannot have both the active and */ /* passive roles in the same interaction, the diagonal cells of */ /* the table are structural zeros. */ /* */ /* From: Fienberg (1980, Table 8-2) */ /* */ /* Illustrate: log-linear model, structural zeros and random */ /* zeros */ /* */ /*----------------------------------------------------------------*/ title 'BEHAVIOR OF SQUIRREL MONKEYS'; data display; input active $ passive $ wt @@; if active ne 't'; if active ne passive then if wt=0 then wt=1e-20; cards; r r 0 r s 1 r t 5 r u 8 r v 9 r w 0 s r 29 s s 0 s t 14 s u 46 s v 4 s w 0 t r 0 t s 0 t t 0 t u 0 t v 0 t w 0 u r 2 u s 3 u t 1 u u 0 u v 38 u w 2 v r 0 v s 0 v t 0 v u 0 v v 0 v w 1 w r 9 w s 25 w t 4 w u 6 w v 13 w w 0 ; proc catmod; weight wt; model active*passive=_response_ / ml nogls freq pred=freq noparm noresponse; loglin active passive; title2 'TEST QUASI-INDEPENDENCE FOR THE INCOMPLETE TABLE'; run;