7.7 The data in Table 7.16, from a General Social Survey, are in the Spending data file at the text website. Subjects were asked about government spending on the envi- ronment (E), health (H), assistance to big cities (C), and law enforcement (L).The common response scale was (1 = too little, 2 = about right, 3 = too much). Compare the models with all two-factor and with all three-factor terms. For the homogeneous association model. estimate the conditional odds ratios using the too much and too little categories for each pair of variables. Summarize the associations. Based on these results, which term(s) might you consider dropping from the model? Why?

fit<-read.table("http://users.stat.ufl.edu/~aa/cat/data/Spending.dat",header=TRUE)
head(fit,2)
##   e h c l count
## 1 1 1 1 1    62
## 2 1 1 1 2    17
fit1<-glm(count~factor(e)*factor(h)+factor(e)*factor(c)+factor(e)*factor(l)+factor(h)*factor(c)+factor(h)*factor(l)+factor(c)*factor(l), family = poisson, data=fit)
summary(fit1)
## 
## Call:
## glm(formula = count ~ factor(e) * factor(h) + factor(e) * factor(c) + 
##     factor(e) * factor(l) + factor(h) * factor(c) + factor(h) * 
##     factor(l) + factor(c) * factor(l), family = poisson, data = fit)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -1.62783  -0.47669  -0.07639   0.33622   1.49280  
## 
## Coefficients:
##                       Estimate Std. Error z value Pr(>|z|)    
## (Intercept)            4.13581    0.11860  34.873  < 2e-16 ***
## factor(e)2            -1.87605    0.25914  -7.240 4.50e-13 ***
## factor(e)3            -3.35321    0.49608  -6.759 1.39e-11 ***
## factor(h)2            -1.71829    0.24541  -7.002 2.53e-12 ***
## factor(h)3            -3.32730    0.43918  -7.576 3.56e-14 ***
## factor(c)2             0.35994    0.15091   2.385 0.017077 *  
## factor(c)3             0.18281    0.15530   1.177 0.239138    
## factor(l)2            -1.22106    0.21381  -5.711 1.12e-08 ***
## factor(l)3            -2.82469    0.42119  -6.706 1.99e-11 ***
## factor(e)2:factor(h)2  0.30916    0.24086   1.284 0.199289    
## factor(e)3:factor(h)2  0.72034    0.42138   1.709 0.087363 .  
## factor(e)2:factor(h)3  1.41304    0.41061   3.441 0.000579 ***
## factor(e)3:factor(h)3  2.14249    0.55665   3.849 0.000119 ***
## factor(e)2:factor(c)2  0.49541    0.29000   1.708 0.087576 .  
## factor(e)3:factor(c)2 -0.18961    0.62730  -0.302 0.762446    
## factor(e)2:factor(c)3  0.50830    0.29291   1.735 0.082676 .  
## factor(e)3:factor(c)3  1.20002    0.51769   2.318 0.020448 *  
## factor(e)2:factor(l)2  0.18129    0.22199   0.817 0.414120    
## factor(e)3:factor(l)2 -0.50679    0.43985  -1.152 0.249249    
## factor(e)2:factor(l)3  0.13019    0.41894   0.311 0.755978    
## factor(e)3:factor(l)3 -0.13285    0.63780  -0.208 0.835001    
## factor(h)2:factor(c)2  0.26396    0.27714   0.952 0.340864    
## factor(h)3:factor(c)2 -0.93284    0.53780  -1.735 0.082819 .  
## factor(h)2:factor(c)3  0.28104    0.28199   0.997 0.318940    
## factor(h)3:factor(c)3 -0.18648    0.45472  -0.410 0.681730    
## factor(h)2:factor(l)2  0.72344    0.20826   3.474 0.000513 ***
## factor(h)3:factor(l)2  0.83749    0.42130   1.988 0.046826 *  
## factor(h)2:factor(l)3 -0.06301    0.47762  -0.132 0.895044    
## factor(h)3:factor(l)3  1.87407    0.50792   3.690 0.000225 ***
## factor(c)2:factor(l)2  0.42931    0.24677   1.740 0.081907 .  
## factor(c)3:factor(l)2  0.30279    0.25359   1.194 0.232469    
## factor(c)2:factor(l)3 -0.20576    0.54351  -0.379 0.705005    
## factor(c)3:factor(l)3  0.87351    0.46044   1.897 0.057811 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 1370.458  on 80  degrees of freedom
## Residual deviance:   31.669  on 48  degrees of freedom
## AIC: 304.5
## 
## Number of Fisher Scoring iterations: 5
fit2<-glm(count~factor(e)*factor(h)*factor(c)+factor(e)*factor(h)*factor(l)+factor(e)*factor(c)*factor(l)+factor(h)*factor(c)*factor(l), family = poisson, data=fit)
## Warning: glm.fit: fitted rates numerically 0 occurred
summary(fit2)
## 
## Call:
## glm(formula = count ~ factor(e) * factor(h) * factor(c) + factor(e) * 
##     factor(h) * factor(l) + factor(e) * factor(c) * factor(l) + 
##     factor(h) * factor(c) * factor(l), family = poisson, data = fit)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -1.08934  -0.11186  -0.00002   0.11730   0.73809  
## 
## Coefficients:
##                                    Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                       4.141e+00  1.254e-01  33.020  < 2e-16 ***
## factor(e)2                       -1.827e+00  3.252e-01  -5.618 1.93e-08 ***
## factor(e)3                       -3.043e+00  5.908e-01  -5.150 2.60e-07 ***
## factor(h)2                       -1.830e+00  3.283e-01  -5.573 2.50e-08 ***
## factor(h)3                       -3.436e+00  6.704e-01  -5.125 2.97e-07 ***
## factor(c)2                        3.532e-01  1.631e-01   2.165   0.0304 *  
## factor(c)3                        1.573e-01  1.701e-01   0.924   0.3553    
## factor(l)2                       -1.327e+00  2.687e-01  -4.938 7.90e-07 ***
## factor(l)3                       -2.653e+00  4.839e-01  -5.482 4.21e-08 ***
## factor(e)2:factor(h)2             1.625e-01  6.642e-01   0.245   0.8067    
## factor(e)3:factor(h)2             7.311e-01  1.200e+00   0.609   0.5425    
## factor(e)2:factor(h)3             1.097e+00  1.009e+00   1.087   0.2771    
## factor(e)3:factor(h)3             2.337e+00  1.335e+00   1.751   0.0800 .  
## factor(e)2:factor(c)2             3.913e-01  3.940e-01   0.993   0.3206    
## factor(e)3:factor(c)2            -6.708e-01  8.783e-01  -0.764   0.4450    
## factor(e)2:factor(c)3             5.534e-01  3.988e-01   1.388   0.1652    
## factor(e)3:factor(c)3             9.207e-01  6.874e-01   1.340   0.1804    
## factor(h)2:factor(c)2             4.625e-01  3.944e-01   1.173   0.2410    
## factor(h)3:factor(c)2            -5.460e-01  9.565e-01  -0.571   0.5681    
## factor(h)2:factor(c)3             4.808e-01  4.067e-01   1.182   0.2372    
## factor(h)3:factor(c)3            -5.957e-01  9.631e-01  -0.618   0.5363    
## factor(e)2:factor(l)2             2.117e-01  5.773e-01   0.367   0.7139    
## factor(e)3:factor(l)2            -2.139e+01  1.453e+04  -0.001   0.9988    
## factor(e)2:factor(l)3            -2.256e-01  1.240e+00  -0.182   0.8557    
## factor(e)3:factor(l)3            -2.071e+01  7.635e+03  -0.003   0.9978    
## factor(h)2:factor(l)2             1.083e+00  5.024e-01   2.156   0.0311 *  
## factor(h)3:factor(l)2             1.500e+00  8.974e-01   1.671   0.0947 .  
## factor(h)2:factor(l)3            -1.918e+01  9.446e+03  -0.002   0.9984    
## factor(h)3:factor(l)3             2.398e+00  1.071e+00   2.239   0.0252 *  
## factor(c)2:factor(l)2             5.669e-01  3.226e-01   1.757   0.0789 .  
## factor(c)3:factor(l)2             4.767e-01  3.364e-01   1.417   0.1565    
## factor(c)2:factor(l)3            -5.572e-01  7.027e-01  -0.793   0.4278    
## factor(c)3:factor(l)3             7.479e-01  5.766e-01   1.297   0.1946    
## factor(e)2:factor(h)2:factor(c)2 -1.724e-01  7.193e-01  -0.240   0.8106    
## factor(e)3:factor(h)2:factor(c)2  4.521e-01  1.504e+00   0.301   0.7637    
## factor(e)2:factor(h)3:factor(c)2  6.724e-01  1.230e+00   0.547   0.5846    
## factor(e)3:factor(h)3:factor(c)2 -1.949e+01  1.350e+04  -0.001   0.9988    
## factor(e)2:factor(h)2:factor(c)3 -9.485e-02  7.403e-01  -0.128   0.8981    
## factor(e)3:factor(h)2:factor(c)3 -1.276e-01  1.348e+00  -0.095   0.9246    
## factor(e)2:factor(h)3:factor(c)3  1.217e+00  1.112e+00   1.094   0.2740    
## factor(e)3:factor(h)3:factor(c)3 -4.823e-01  1.836e+00  -0.263   0.7928    
## factor(e)2:factor(h)2:factor(l)2  5.134e-01  5.082e-01   1.010   0.3124    
## factor(e)3:factor(h)2:factor(l)2  5.656e-02  1.015e+00   0.056   0.9556    
## factor(e)2:factor(h)3:factor(l)2 -8.817e-01  1.010e+00  -0.873   0.3828    
## factor(e)3:factor(h)3:factor(l)2  3.972e-01  1.674e+00   0.237   0.8125    
## factor(e)2:factor(h)2:factor(l)3  4.775e-01  1.099e+00   0.434   0.6641    
## factor(e)3:factor(h)2:factor(l)3 -1.805e+01  6.693e+03  -0.003   0.9978    
## factor(e)2:factor(h)3:factor(l)3 -3.357e-01  1.233e+00  -0.272   0.7853    
## factor(e)3:factor(h)3:factor(l)3  2.046e+00  1.977e+00   1.035   0.3008    
## factor(e)2:factor(c)2:factor(l)2  7.886e-02  6.447e-01   0.122   0.9026    
## factor(e)3:factor(c)2:factor(l)2  2.117e+01  1.453e+04   0.001   0.9988    
## factor(e)2:factor(c)3:factor(l)2 -3.892e-01  6.658e-01  -0.585   0.5588    
## factor(e)3:factor(c)3:factor(l)2  2.084e+01  1.453e+04   0.001   0.9989    
## factor(e)2:factor(c)2:factor(l)3  7.037e-01  1.441e+00   0.488   0.6253    
## factor(e)3:factor(c)2:factor(l)3  3.266e+00  1.466e+04   0.000   0.9998    
## factor(e)2:factor(c)3:factor(l)3  2.190e-01  1.347e+00   0.163   0.8708    
## factor(e)3:factor(c)3:factor(l)3  2.043e+01  7.635e+03   0.003   0.9979    
## factor(h)2:factor(c)2:factor(l)2 -5.844e-01  5.861e-01  -0.997   0.3187    
## factor(h)3:factor(c)2:factor(l)2 -1.825e+00  1.447e+00  -1.262   0.2071    
## factor(h)2:factor(c)3:factor(l)2 -5.786e-01  6.080e-01  -0.952   0.3413    
## factor(h)3:factor(c)3:factor(l)2  1.918e-01  1.150e+00   0.167   0.8675    
## factor(h)2:factor(c)2:factor(l)3  1.879e+01  9.446e+03   0.002   0.9984    
## factor(h)3:factor(c)2:factor(l)3  3.365e-02  1.506e+00   0.022   0.9822    
## factor(h)2:factor(c)3:factor(l)3  1.936e+01  9.446e+03   0.002   0.9984    
## factor(h)3:factor(c)3:factor(l)3 -1.168e+00  1.486e+00  -0.786   0.4318    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 1370.4575  on 80  degrees of freedom
## Residual deviance:    8.5237  on 16  degrees of freedom
## AIC: 345.36
## 
## Number of Fisher Scoring iterations: 19

Model fit1(homogeneous model) has an AIC of 304.5 and model fit2 has an AIC of 345.36. Since a model with a lower AIC is better, we would choose model fit 1.

-The estimated conditional odd ratio of too much to too little satisfy for environment and health is exp(2.14)
-The estimated conditional odd ratio of too much to too little satisfy for environment and assistance to big cities is exp(1.2)
-The estimated conditional odd ratio of too much to too little satisfy satisfy for environment and law enforcement is exp(-0.13)
-The estimated conditional odd ratio of too much to too little satisfy satisfy for health and assistance to big cities is exp(-0.18)
-The estimated conditional odd ratio of too much to too little satisfy satisfy for health and law enforcement is exp(1.87)
-The estimated conditional odd ratio of too much to too little satisfy satisfy for assistance to big cities and law enforcement is exp(0.87)

Results from summary(fit2)-homogenous model:
factor(e)2:factor(l)3 0.13019 0.41894 0.311 0.755978
factor(h)3:factor(c)3 -0.18648 0.45472 -0.410 0.681730

Out of all the association terms, the p-value of e_1:l_3 and h_3:c_3 are less than 0.05 which are insignificant. e_1:l_3 and h_3:c_3 would be dropped.