R Under development (unstable) (2025-08-24 r88696 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## Goodman (1991), Table 17.1 (p. 1097) > # See also ?rc > > library(logmult) Loading required package: gnm Attaching package: 'logmult' The following object is masked from 'package:gnm': se > data(criminal) > > model <- rc(criminal, start=NA) Running base model to find starting values... Running real model... Initialising Running main iterations............... Done > > model$assoc # These are the phi (.07), mu and nu $phi Dim1 [1,] 0.07051354 $row , , 1 Dim1 1955 1.2591887 1956 0.8225979 1957 -0.5602021 1958 -1.2074486 $col , , 1 Dim1 15 -1.4350272 16 -1.2965748 17 -0.3324492 18 0.9995791 19 0.8889776 $diagonal numeric(0) $weighting [1] "marginal" $row.weights [,1] 1955 1614 1956 1615 1957 1889 1958 1907 $col.weights [,1] 15 693 16 1381 17 1485 18 1786 19 1680 $vars [1] "Year" "Age" $covmat numeric(0) $adj.covmats numeric(0) $boot.results numeric(0) $jack.results numeric(0) $covtype [1] "none" attr(,"class") [1] "assoc.rc" "assoc" > model$assoc$row[,1,1] * model$assoc$phi[1,1] # These are the mu' 1955 1956 1957 1958 0.08878985 0.05800429 -0.03950183 -0.08514147 > model$assoc$col[,1,1] * model$assoc$phi[1,1] # These are the nu' 15 16 17 18 19 -0.10118884 -0.09142608 -0.02344217 0.07048386 0.06268496 > > stopifnot(round(model$assoc$phi[1,1], d=2) == 0.07) > # Scores have reversed signs compared to the orignal article > stopifnot(isTRUE(all.equal(round(model$assoc$row[,1,1], d=2), + c(1.26, 0.82, -0.56, -1.21), + check.attributes=FALSE))) > stopifnot(isTRUE(all.equal(round(model$assoc$col[,1,1], d=2), + c(-1.44, -1.30, -0.33, 1.00, 0.89), + check.attributes=FALSE))) > > proc.time() user system elapsed 0.79 0.14 0.92