Model Count Data from a Contingency Table
Fit count data from a contingency table and display data, fitted values and standardized residuals in tabular form.
 In[1]:= ```data = {{groupA, agree, 15}, {groupA, disagree, 66}, {groupB, disagree, 63}, {groupB, disagree, 90}, {groupC, agree, 92}, {groupC, disagree, 46}};```
 In[2]:= ```model = GeneralizedLinearModelFit[data, {var1, var2}, {var1, var2}, NominalVariables -> All, ExponentialFamily -> "Poisson"];```
 In[3]:= `colorItem[item_, gl_: .95] := Item[item, Background -> GrayLevel[gl]]`
 In[4]:= ```gridForProperty[prop_, title_] := Grid[Join[{{colorItem[title, .85], SpanFromLeft}, Map[colorItem, {"", "Group A", "Group B", "Group C"}]}, Join[{{colorItem["Agree"]}, {colorItem["Disagree"]}}, Transpose[Partition[model[prop], 2]], 2]], Dividers -> All, ItemSize -> {10, 1.5}]```
 In[5]:= ```gridForProperty2[prop_, title_] := Grid[Join[{{colorItem[title, .85], SpanFromLeft}, Map[colorItem, {"", "Group A", "Group B", "Group C"}]}, Join[{{colorItem["Agree"]}, {colorItem["Disagree"]}}, Transpose[ Partition[ Map[Column[#, Alignment -> {Center}] &, Transpose[model[prop]]], 2]], 2]], Dividers -> All, ItemSize -> {10, 2}]```
 In[6]:= ```Style[Column[{gridForProperty["Response", "Counts"], gridForProperty["PredictedResponse", "Predicted Values"], gridForProperty2[{"FitResiduals", "StandardizedPearsonResiduals"}, "Residuals & Standardized Residuals"]}, Spacings -> 2], "DialogStyle"]```
 Out[6]=