%   
% Example 12.6. Anolis Lizards of Bimini.
% This well-known data set comes from the paper of Schoener (1968) 
% and is also used in Fienberg (1970). 
% The researcher was  interested in structural habitat categories for 
% Anolis lizards of Bimini: sagrei (brown anole)  adult males versus 
% distichus (trunk anole) adult and subadult males. 
% The brown anole and trunk  anole are medium- sized, fairly robust,
% "trunk-ground" lizards. 
% They generally prefer the fairly  open vegetation of disturbed sites,
% where they adopt a head-down, sit-and-wait posture and perch 
% low on large trunks or fenceposts 
%  
% The researcher was interested in the preferences of these two 
% species (P) with respect to the perch height (R) and diameter (C).
% 
%  The data is classified with respect to three dichotomous factors: 
%  Height at levels Low (? 4.75) and  High (> 4.75), 
%  Diameter at levels Small (? 4) and Large (> 4), 
%  and Species with levels A. sagrei and A. distichus.
%  
%  Are these three factors independent? 
%  Are they jointly independent? 
%  Are they conditionally independent?
% 
% 

  obs= cat(3, [44 12; 28 22],[38 10; 20 18]);
  
  [chi2,df, pvalue,exp]=tablerxcxp(obs)   %0.0107
  
  [chi2, df pvalue,exp]=jointrxcxp(obs,'r_cp')   %0.0044
  [chi2, df pvalue,exp]=jointrxcxp(obs,'c_rp')   %0.0047
  [chi2, df pvalue,exp]=jointrxcxp(obs,'p_rc')   %0.9649

  [chi2, df pvalue,exp]=conditionalrxcxp(obs,'rc_p')   %0.0015
  [chi2, df pvalue,exp]=conditionalrxcxp(obs,'rp_c')   %0.8742
  [chi2, df pvalue,exp]=conditionalrxcxp(obs,'cp_r')   %0.9492
