Running examples in 'catspec-Ex.R' failed
The error most likely occurred in:

> ### Name: sqtab
> ### Title: sqtab: models for square tables
> ### Aliases: sqtab check.square fitmacro mob.cp mob.eqmain mob.qi mob.rc1
> ###   mob.symint mob.unif
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> # Examples of loglinear models for square tables,
> # from Hout, M. (1983). "Mobility Tables". Sage Publication 07-031
> 
> # Table from page 11 of "Mobility Tables"
> # Original source: Featherman D.L., R.M. Hauser. (1978) "Opportunity and Change."
> # New York: Academic, page 49
> 
> Freq <- c(
+ 1414,  521,  302,   643,   40,
+  724,  524,  254,   703,   48,
+  798,  648,  856,  1676,  108,
+  756,  914,  771,  3325,  237,
+  409,  357,  441,  1611, 1832)
> 
> OccFather<-gl(5,5,labels=c("Upper nonmanual","Lower nonmanual","Upper manual","Lower manual","Farm"))
> OccSon<-gl(5,1,labels=c("Upper nonmanual","Lower nonmanual","Upper manual","Lower manual","Farm"))
> FHtab <- data.frame(OccFather,OccSon,Freq)
> 
> xtabs(Freq~OccFather+OccSon,data=FHtab)
                 OccSon
OccFather         Upper nonmanual Lower nonmanual Upper manual Lower manual
  Upper nonmanual            1414             521          302          643
  Lower nonmanual             724             524          254          703
  Upper manual                798             648          856         1676
  Lower manual                756             914          771         3325
  Farm                        409             357          441         1611
                 OccSon
OccFather         Farm
  Upper nonmanual   40
  Lower nonmanual   48
  Upper manual     108
  Lower manual     237
  Farm            1832
> 
> # independence model
> indep<-glm(Freq~OccFather+OccSon,family=poisson(),data=FHtab)
> summary(indep)

Call:
glm(formula = Freq ~ OccFather + OccSon, family = poisson(), 
    data = FHtab)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-20.371  -14.730   -2.554    4.015   44.109  

Coefficients:
                         Estimate Std. Error z value Pr(>|z|)    
(Intercept)               6.39925    0.02315 276.383   <2e-16 ***
OccFatherLower nonmanual -0.25932    0.02804  -9.248   <2e-16 ***
OccFatherUpper manual     0.33598    0.02423  13.865   <2e-16 ***
OccFatherLower manual     0.72068    0.02256  31.942   <2e-16 ***
OccFatherFarm             0.46528    0.02361  19.706   <2e-16 ***
OccSonLower nonmanual    -0.32469    0.02411 -13.468   <2e-16 ***
OccSonUpper manual       -0.44653    0.02500 -17.862   <2e-16 ***
OccSonLower manual        0.66295    0.01922  34.488   <2e-16 ***
OccSonFarm               -0.59366    0.02618 -22.677   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.1  on 24  degrees of freedom
Residual deviance:  6170.1  on 16  degrees of freedom
AIC: 6390.8

Number of Fisher Scoring iterations: 6

> fitmacro(indep)

 
deviance:                 6170.130 
df:                             16 
bic:                      6011.745 
aic:                      6138.130 
Number of parameters:            9 
Number of cases:             19912 

 
> 
> wt <- as.numeric(OccFather != OccSon)
> qi0<-glm(Freq~OccFather+OccSon,weights=wt,family=poisson(),data=FHtab)
> # A quasi-independence loglinear model, using structural zeros
> # (page 23 of "Mobility Tables").
> #  0  1  1  1  1   values of variable "wt"
> #  1  0  1  1  1
> #  1  1  0  1  1
> #  1  1  1  0  1
> #  1  1  1  1  0
> qi0<-glm(Freq~OccFather+OccSon,weights=wt,family=poisson(),data=FHtab)
> summary(qi0)

Call:
glm(formula = Freq ~ OccFather + OccSon, family = poisson(), 
    data = FHtab, weights = wt)

Deviance Residuals: 
   Min      1Q  Median      3Q     Max  
-8.181  -3.336   0.000   1.558  13.465  

Coefficients:
                         Estimate Std. Error z value Pr(>|z|)    
(Intercept)               5.91935    0.03433 172.444  < 2e-16 ***
OccFatherLower nonmanual  0.11956    0.03588   3.332 0.000861 ***
OccFatherUpper manual     0.70710    0.03188  22.179  < 2e-16 ***
OccFatherLower manual     0.92052    0.03430  26.838  < 2e-16 ***
OccFatherFarm             0.44093    0.03230  13.653  < 2e-16 ***
OccSonLower nonmanual    -0.07868    0.02847  -2.764 0.005710 ** 
OccSonUpper manual       -0.26496    0.03137  -8.446  < 2e-16 ***
OccSonLower manual        0.77953    0.02591  30.081  < 2e-16 ***
OccSonFarm               -1.74558    0.05210 -33.506  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 6123.71  on 19  degrees of freedom
Residual deviance:  683.34  on 11  degrees of freedom
AIC: 858.97

Number of Fisher Scoring iterations: 4

> fitmacro(qi0)

 
deviance:                  683.342 
df:                             11 
bic:                       574.452 
aic:                       661.342 
Number of parameters:            9 
Number of cases:             19912 

 
> 
> # Quasi-independence using a "dummy factor" to create the design
> # vectors for the diagonal cells (page 23).
> #  1  0  0  0  0
> #  0  2  0  0  0
> #  0  0  3  0  0
> #  0  0  0  4  0
> #  0  0  0  0  5
> glm.qi<-glm(Freq~OccFather+OccSon+mob.qi(OccFather,OccSon),family=poisson(),data=FHtab)
> summary(glm.qi)

Call:
glm(formula = Freq ~ OccFather + OccSon + mob.qi(OccFather, OccSon), 
    family = poisson(), data = FHtab)

Deviance Residuals: 
   Min      1Q  Median      3Q     Max  
-8.181  -3.336   0.000   1.558  13.465  

Coefficients:
                           Estimate Std. Error z value Pr(>|z|)    
(Intercept)                 5.91935    0.03433 172.444  < 2e-16 ***
OccFatherLower nonmanual    0.11956    0.03588   3.332 0.000861 ***
OccFatherUpper manual       0.70710    0.03188  22.179  < 2e-16 ***
OccFatherLower manual       0.92052    0.03430  26.838  < 2e-16 ***
OccFatherFarm               0.44093    0.03230  13.653  < 2e-16 ***
OccSonLower nonmanual      -0.07868    0.02847  -2.764 0.005710 ** 
OccSonUpper manual         -0.26496    0.03137  -8.446  < 2e-16 ***
OccSonLower manual          0.77953    0.02591  30.081  < 2e-16 ***
OccSonFarm                 -1.74558    0.05210 -33.506  < 2e-16 ***
mob.qi(OccFather, OccSon)2  1.33483    0.04342  30.741  < 2e-16 ***
mob.qi(OccFather, OccSon)3  0.30126    0.05512   5.465 4.62e-08 ***
mob.qi(OccFather, OccSon)4  0.39079    0.04695   8.323  < 2e-16 ***
mob.qi(OccFather, OccSon)5  0.48983    0.03330  14.711  < 2e-16 ***
mob.qi(OccFather, OccSon)6  2.89847    0.05774  50.197  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.14  on 24  degrees of freedom
Residual deviance:   683.34  on 11  degrees of freedom
AIC: 914.05

Number of Fisher Scoring iterations: 4

> fitmacro(glm.qi)

 
deviance:                  683.342 
df:                             11 
bic:                       574.452 
aic:                       661.342 
Number of parameters:           14 
Number of cases:             19912 

 
> 
> # Quasi-independence without using the functions
> # Factor labels prevent numeric comparisons, create numeric versions
> # of the row and column variables
> OccFather_n <- unclass(OccFather)
> OccSon_n <- unclass(OccSon)
> q1 <- ifelse(OccFather_n==OccSon_n & OccSon_n==1,1,0)
> q2 <- ifelse(OccFather_n==OccSon_n & OccSon_n==2,1,0)
> q3 <- ifelse(OccFather_n==OccSon_n & OccSon_n==3,1,0)
> q4 <- ifelse(OccFather_n==OccSon_n & OccSon_n==4,1,0)
> q5 <- ifelse(OccFather_n==OccSon_n & OccSon_n==5,1,0)
> glm.qi2<-glm(Freq~OccFather+OccSon+q1+q2+q3+q4+q5,family=poisson(),data=FHtab)
> summary(glm.qi2)

Call:
glm(formula = Freq ~ OccFather + OccSon + q1 + q2 + q3 + q4 + 
    q5, family = poisson(), data = FHtab)

Deviance Residuals: 
   Min      1Q  Median      3Q     Max  
-8.181  -3.336   0.000   1.558  13.465  

Coefficients:
                         Estimate Std. Error z value Pr(>|z|)    
(Intercept)               5.91935    0.03433 172.444  < 2e-16 ***
OccFatherLower nonmanual  0.11956    0.03588   3.332 0.000861 ***
OccFatherUpper manual     0.70710    0.03188  22.179  < 2e-16 ***
OccFatherLower manual     0.92052    0.03430  26.838  < 2e-16 ***
OccFatherFarm             0.44093    0.03230  13.653  < 2e-16 ***
OccSonLower nonmanual    -0.07868    0.02847  -2.764 0.005710 ** 
OccSonUpper manual       -0.26496    0.03137  -8.446  < 2e-16 ***
OccSonLower manual        0.77953    0.02591  30.081  < 2e-16 ***
OccSonFarm               -1.74558    0.05210 -33.506  < 2e-16 ***
q1                        1.33483    0.04342  30.741  < 2e-16 ***
q2                        0.30126    0.05512   5.465 4.62e-08 ***
q3                        0.39079    0.04695   8.323  < 2e-16 ***
q4                        0.48983    0.03330  14.711  < 2e-16 ***
q5                        2.89847    0.05774  50.197  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.14  on 24  degrees of freedom
Residual deviance:   683.34  on 11  degrees of freedom
AIC: 914.05

Number of Fisher Scoring iterations: 4

> fitmacro(glm.qi2)

 
deviance:                  683.342 
df:                             11 
bic:                       574.452 
aic:                       661.342 
Number of parameters:           14 
Number of cases:             19912 

 
> 
> # Quasi-independence constrained (QPM-C, page 31)
> # Single immobility parameter
> #  1  0  0  0  0
> #  0  1  0  0  0
> #  0  0  1  0  0
> #  0  0  0  1  0
> #  0  0  0  0  1
> glm.q0<-glm(Freq~OccFather+OccSon+mob.qi(OccFather,OccSon,constrained=TRUE),family=poisson(),data=FHtab)
> # slightly different results than Hout also found in Stata: L2=2567.658, q0=0.964
> summary(glm.q0)

Call:
glm(formula = Freq ~ OccFather + OccSon + mob.qi(OccFather, OccSon, 
    constrained = TRUE), family = poisson(), data = FHtab)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-17.785   -8.712    1.196    4.545   20.115  

Coefficients:
                                               Estimate Std. Error z value
(Intercept)                                     6.16634    0.02193 281.135
OccFatherLower nonmanual                       -0.18999    0.02866  -6.628
OccFatherUpper manual                           0.45477    0.02500  18.194
OccFatherLower manual                           0.54946    0.02351  23.369
OccFatherFarm                                   0.61469    0.02445  25.142
OccSonLower nonmanual                          -0.29151    0.02462 -11.840
OccSonUpper manual                             -0.54963    0.02574 -21.350
OccSonLower manual                              0.53357    0.02001  26.670
OccSonFarm                                     -0.74220    0.02705 -27.441
mob.qi(OccFather, OccSon, constrained = TRUE)2  0.96449    0.01550  62.221
                                               Pr(>|z|)    
(Intercept)                                     < 2e-16 ***
OccFatherLower nonmanual                       3.39e-11 ***
OccFatherUpper manual                           < 2e-16 ***
OccFatherLower manual                           < 2e-16 ***
OccFatherFarm                                   < 2e-16 ***
OccSonLower nonmanual                           < 2e-16 ***
OccSonUpper manual                              < 2e-16 ***
OccSonLower manual                              < 2e-16 ***
OccSonFarm                                      < 2e-16 ***
mob.qi(OccFather, OccSon, constrained = TRUE)2  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.1  on 24  degrees of freedom
Residual deviance:  2567.7  on 15  degrees of freedom
AIC: 2790.4

Number of Fisher Scoring iterations: 5

> fitmacro(glm.q0)

 
deviance:                 2567.658 
df:                             15 
bic:                      2419.172 
aic:                      2537.658 
Number of parameters:           10 
Number of cases:             19912 

 
> 
> # Quasi-symmetry using the symmetric cross-classification (page 23)
> #  0  1  2  3  4   values of variable "sym"
> #  1  0  5  6  7
> #  2  5  0  8  9
> #  3  6  8  0 10
> #  4  7  9 10  0  */
> glm.qsym<-
+ glm(Freq~OccFather+OccSon+mob.symint(OccFather,OccSon),family=poisson(),data=FHtab)
> summary(glm.qsym)

Call:
glm(formula = Freq ~ OccFather + OccSon + mob.symint(OccFather, 
    OccSon), family = poisson(), data = FHtab)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-2.3247  -0.4558   0.0000   0.6836   2.0935  

Coefficients:
                                 Estimate Std. Error z value Pr(>|z|)    
(Intercept)                       7.25418    0.02659 272.780   <2e-16 ***
OccFatherLower nonmanual         -0.74821    0.04311 -17.355   <2e-16 ***
OccFatherUpper manual            -0.55598    0.04166 -13.345   <2e-16 ***
OccFatherLower manual            -0.56958    0.04100 -13.891   <2e-16 ***
OccFatherFarm                    -1.24550    0.05447 -22.868   <2e-16 ***
OccSonLower nonmanual            -0.89828    0.04450 -20.184   <2e-16 ***
OccSonUpper manual               -1.58756    0.05056 -31.397   <2e-16 ***
OccSonLower manual               -0.85890    0.04341 -19.786   <2e-16 ***
OccSonFarm                       -3.51518    0.07705 -45.624   <2e-16 ***
mob.symint(OccFather, OccSon)2:2  0.32690    0.03820   8.557   <2e-16 ***
mob.symint(OccFather, OccSon)2:3  0.65816    0.06032  10.910   <2e-16 ***
mob.symint(OccFather, OccSon)2:4  0.97607    0.05347  18.256   <2e-16 ***
mob.symint(OccFather, OccSon)2:5  0.78009    0.08074   9.662   <2e-16 ***
mob.symint(OccFather, OccSon)3:3  0.82082    0.03841  21.370   <2e-16 ***
mob.symint(OccFather, OccSon)3:4  1.57396    0.05351  29.414   <2e-16 ***
mob.symint(OccFather, OccSon)3:5  1.63239    0.07953  20.526   <2e-16 ***
mob.symint(OccFather, OccSon)4:4  1.14176    0.03121  36.583   <2e-16 ***
mob.symint(OccFather, OccSon)4:5  2.24279    0.06714  33.406   <2e-16 ***
mob.symint(OccFather, OccSon)5:5  2.50983    0.05607  44.763   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.143  on 24  degrees of freedom
Residual deviance:    27.448  on  6  degrees of freedom
AIC: 268.16

Number of Fisher Scoring iterations: 3

> fitmacro(glm.qsym)

 
deviance:                   27.448 
df:                              6 
bic:                       -31.947 
aic:                        15.448 
Number of parameters:           19 
Number of cases:             19912 

 
> 
> symmetry<-glm(Freq~mob.eqmain(OccFather,OccSon)
+ +mob.symint(OccFather,OccSon),family=poisson(),data=FHtab)
> summary(symmetry)

Call:
glm(formula = Freq ~ mob.eqmain(OccFather, OccSon) + mob.symint(OccFather, 
    OccSon), family = poisson(), data = FHtab)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-27.001  -10.116    0.000    8.701   20.423  

Coefficients:
                                 Estimate Std. Error z value Pr(>|z|)    
(Intercept)                       7.25418    0.02659 272.780   <2e-16 ***
mob.eqmain(OccFather, OccSon)2   -0.82043    0.03886 -21.110   <2e-16 ***
mob.eqmain(OccFather, OccSon)3   -0.94426    0.04020 -23.487   <2e-16 ***
mob.eqmain(OccFather, OccSon)4   -0.70381    0.03771 -18.664   <2e-16 ***
mob.eqmain(OccFather, OccSon)5   -1.84030    0.05417 -33.973   <2e-16 ***
mob.symint(OccFather, OccSon)2:2  0.32409    0.03817   8.490   <2e-16 ***
mob.symint(OccFather, OccSon)2:3  0.62198    0.05940  10.471   <2e-16 ***
mob.symint(OccFather, OccSon)2:4  0.96525    0.05333  18.101   <2e-16 ***
mob.symint(OccFather, OccSon)2:5  0.71730    0.07878   9.105   <2e-16 ***
mob.symint(OccFather, OccSon)3:3  0.69331    0.03712  18.677   <2e-16 ***
mob.symint(OccFather, OccSon)3:4  1.50336    0.05234  28.722   <2e-16 ***
mob.symint(OccFather, OccSon)3:5  1.14534    0.07527  15.217   <2e-16 ***
mob.symint(OccFather, OccSon)4:4  1.13134    0.03109  36.385   <2e-16 ***
mob.symint(OccFather, OccSon)4:5  2.11865    0.06473  32.729   <2e-16 ***
mob.symint(OccFather, OccSon)5:5  1.96979    0.05040  39.081   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.1  on 24  degrees of freedom
Residual deviance:  2804.9  on 10  degrees of freedom
AIC: 3037.6

Number of Fisher Scoring iterations: 5

> fitmacro(symmetry)

 
deviance:                 2804.873 
df:                             10 
bic:                      2705.882 
aic:                      2784.873 
Number of parameters:           15 
Number of cases:             19912 

 
> 
> # Crossings parameter model (page 35)
> #  0  v1 v1 v1 v1 |  0  0  v2 v2 v2 |  0  0  0  v3 v3 |  0  0  0  0 v4
> #  v1 0  0  0  0  |  0  0  v2 v2 v2 |  0  0  0  v3 v3 |  0  0  0  0 v4
> #  v1 0  0  0  0  |  v2 v2 0  0  0  |  0  0  0  v3 v3 |  0  0  0  0 v4
> #  v1 0  0  0  0  |  v2 v2 0  0  0  |  v3 v3 v3 0  0  |  0  0  0  0 v4
> #  v1 0  0  0  0  |  v2 v2 0  0  0  |  v3 v3 v3 0  0  |  v4 v4 v4 v4 0
> glm.cp<-glm(Freq~OccFather+OccSon+mob.cp(OccFather,OccSon),family=poisson(),data=FHtab)
> summary(glm.cp)

Call:
glm(formula = Freq ~ OccFather + OccSon + mob.cp(OccFather, OccSon), 
    family = poisson(), data = FHtab)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-3.1888  -0.8059   0.0000   0.6484   5.2990  

Coefficients:
                           Estimate Std. Error z value Pr(>|z|)    
(Intercept)                 7.25418    0.02659 272.780  < 2e-16 ***
OccFatherLower nonmanual   -0.35986    0.02879 -12.500  < 2e-16 ***
OccFatherUpper manual       0.20073    0.02568   7.816 5.45e-15 ***
OccFatherLower manual       0.57421    0.02441  23.521  < 2e-16 ***
OccFatherFarm               1.25914    0.03463  36.365  < 2e-16 ***
OccSonLower nonmanual      -0.53016    0.02700 -19.637  < 2e-16 ***
OccSonUpper manual         -0.79953    0.02810 -28.449  < 2e-16 ***
OccSonLower manual          0.28056    0.02344  11.969  < 2e-16 ***
OccSonFarm                 -1.00015    0.03463 -28.885  < 2e-16 ***
mob.cp(OccFather, OccSon)1 -0.42562    0.02394 -17.776  < 2e-16 ***
mob.cp(OccFather, OccSon)2 -0.36748    0.02115 -17.372  < 2e-16 ***
mob.cp(OccFather, OccSon)3 -0.29347    0.01728 -16.980  < 2e-16 ***
mob.cp(OccFather, OccSon)4 -1.40259    0.02894 -48.458  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.143  on 24  degrees of freedom
Residual deviance:    89.914  on 12  degrees of freedom
AIC: 318.63

Number of Fisher Scoring iterations: 4

> fitmacro(glm.cp)

 
deviance:                   89.914 
df:                             12 
bic:                       -28.875 
aic:                        65.914 
Number of parameters:           13 
Number of cases:             19912 

 
> 
> # Uniform association model: linear by linear association (page 58)
> glm.unif<-glm(Freq~OccFather+OccSon+mob.unif(OccFather,OccSon),family=poisson(),data=FHtab)
> summary(glm.unif)

Call:
glm(formula = Freq ~ OccFather + OccSon + mob.unif(OccFather, 
    OccSon), family = poisson(), data = FHtab)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-24.103   -3.302   -1.461    4.088   25.781  

Coefficients:
                             Estimate Std. Error z value Pr(>|z|)    
(Intercept)                  6.980009   0.021329  327.25   <2e-16 ***
OccFatherLower nonmanual    -0.860564   0.029168  -29.50   <2e-16 ***
OccFatherUpper manual       -0.991014   0.031298  -31.66   <2e-16 ***
OccFatherLower manual       -1.457724   0.042152  -34.58   <2e-16 ***
OccFatherFarm               -2.672356   0.059456  -44.95   <2e-16 ***
OccSonLower nonmanual       -1.046149   0.026393  -39.64   <2e-16 ***
OccSonUpper manual          -2.018346   0.035704  -56.53   <2e-16 ***
OccSonLower manual          -1.876387   0.047874  -39.19   <2e-16 ***
OccSonFarm                  -4.195326   0.069883  -60.03   <2e-16 ***
mob.unif(OccFather, OccSon)  0.269259   0.004804   56.05   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.1  on 24  degrees of freedom
Residual deviance:  2280.7  on 15  degrees of freedom
AIC: 2503.4

Number of Fisher Scoring iterations: 5

> fitmacro(glm.unif)

 
deviance:                 2280.694 
df:                             15 
bic:                      2132.207 
aic:                      2250.694 
Number of parameters:           10 
Number of cases:             19912 

 
> 
> # RC model 1 (unequal row and column effects, page 58)
> # Fits a uniform association parameter and row and column effect
> # parameters. Row and column effect parameters have the
> # restriction that the first and last categories are zero.
> glm.rc1<-glm(Freq~OccFather+OccSon+mob.rc1(OccFather,OccSon),family=poisson(),data=FHtab)
> summary(glm.rc1)

Call:
glm(formula = Freq ~ OccFather + OccSon + mob.rc1(OccFather, 
    OccSon), family = poisson(), data = FHtab)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-15.254   -2.454   -1.352    4.013   13.785  

Coefficients:
                              Estimate Std. Error z value Pr(>|z|)    
(Intercept)                   6.672678   0.026313 253.585  < 2e-16 ***
OccFatherLower nonmanual     -1.154320   0.060824 -18.978  < 2e-16 ***
OccFatherUpper manual        -1.617053   0.061608 -26.247  < 2e-16 ***
OccFatherLower manual        -2.048505   0.067952 -30.147  < 2e-16 ***
OccFatherFarm                -3.636547   0.078946 -46.064  < 2e-16 ***
OccSonLower nonmanual        -1.125905   0.057383 -19.621  < 2e-16 ***
OccSonUpper manual           -1.814371   0.066842 -27.144  < 2e-16 ***
OccSonLower manual           -1.376182   0.060296 -22.824  < 2e-16 ***
OccSonFarm                   -8.992250   0.214486 -41.925  < 2e-16 ***
mob.rc1(OccFather, OccSon)R2  0.029654   0.020919   1.418    0.156    
mob.rc1(OccFather, OccSon)R3  0.079253   0.017742   4.467 7.93e-06 ***
mob.rc1(OccFather, OccSon)R4  0.002588   0.017053   0.152    0.879    
mob.rc1(OccFather, OccSon)U   0.533707   0.011078  48.178  < 2e-16 ***
mob.rc1(OccFather, OccSon)C2 -0.252840   0.020567 -12.293  < 2e-16 ***
mob.rc1(OccFather, OccSon)C3 -0.614921   0.028553 -21.536  < 2e-16 ***
mob.rc1(OccFather, OccSon)C4 -0.960196   0.034636 -27.722  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.14  on 24  degrees of freedom
Residual deviance:   877.81  on  9  degrees of freedom
AIC: 1112.5

Number of Fisher Scoring iterations: 5

> fitmacro(glm.rc1)

 
deviance:                  877.808 
df:                              9 
bic:                       788.717 
aic:                       859.808 
Number of parameters:           16 
Number of cases:             19912 

 
> 
> # Homogeneous row and column effects model 1 (page 58)
> # An equality restriction is placed on the row and column effects
> glm.hrc1<-glm(Freq~OccFather+OccSon+mob.rc1(OccFather,OccSon,equal=TRUE),family=poisson(),data=FHtab)
> # Results differ from those in Hout, replicated by other programs
> summary(glm.hrc1)

Call:
glm(formula = Freq ~ OccFather + OccSon + mob.rc1(OccFather, 
    OccSon, equal = TRUE), family = poisson(), data = FHtab)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-15.800   -3.195   -1.188    3.070   17.434  

Coefficients:
                                             Estimate Std. Error z value
(Intercept)                                  6.798987   0.025260 269.157
OccFatherLower nonmanual                    -0.982508   0.047712 -20.592
OccFatherUpper manual                       -1.022509   0.048903 -20.909
OccFatherLower manual                       -1.141834   0.050288 -22.706
OccFatherFarm                               -3.752391   0.083624 -44.872
OccSonLower nonmanual                       -1.170357   0.050894 -22.996
OccSonUpper manual                          -2.049682   0.057562 -35.608
OccSonLower manual                          -1.570274   0.055556 -28.264
OccSonFarm                                  -5.599423   0.100750 -55.577
mob.rc1(OccFather, OccSon, equal = TRUE)RC2 -0.035255   0.012639  -2.789
mob.rc1(OccFather, OccSon, equal = TRUE)RC3 -0.141634   0.011321 -12.510
mob.rc1(OccFather, OccSon, equal = TRUE)RC4 -0.313500   0.011305 -27.730
mob.rc1(OccFather, OccSon, equal = TRUE)U    0.392262   0.007312  53.649
                                            Pr(>|z|)    
(Intercept)                                  < 2e-16 ***
OccFatherLower nonmanual                     < 2e-16 ***
OccFatherUpper manual                        < 2e-16 ***
OccFatherLower manual                        < 2e-16 ***
OccFatherFarm                                < 2e-16 ***
OccSonLower nonmanual                        < 2e-16 ***
OccSonUpper manual                           < 2e-16 ***
OccSonLower manual                           < 2e-16 ***
OccSonFarm                                   < 2e-16 ***
mob.rc1(OccFather, OccSon, equal = TRUE)RC2  0.00528 ** 
mob.rc1(OccFather, OccSon, equal = TRUE)RC3  < 2e-16 ***
mob.rc1(OccFather, OccSon, equal = TRUE)RC4  < 2e-16 ***
mob.rc1(OccFather, OccSon, equal = TRUE)U    < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for poisson family taken to be 1)

    Null deviance: 13132.1  on 24  degrees of freedom
Residual deviance:  1451.3  on 12  degrees of freedom
AIC: 1680.1

Number of Fisher Scoring iterations: 5

> fitmacro(glm.hrc1)

 
deviance:                 1451.347 
df:                             12 
bic:                      1332.558 
aic:                      1427.347 
Number of parameters:           13 
Number of cases:             19912 

 
> 
> #-------------------------------------------------------------------------------
> # Examples on using these models in multinomial logistic regression
> #-------------------------------------------------------------------------------
> # Data from the 1972-78 GSS used by Logan (1983)
> library(survival)
> data(logan)
> 
> # Restructure the data in 'long' format using mlogit.data
> library(mlogit)
Error in library(mlogit) : there is no package called 'mlogit'
Execution halted