logmult (version 0.7.1)

anoas: Analysis of Association Functions

Description

These functions allow performing in a straightforward and efficient way an analysis of association (ANOAS) consisting of successive RC(M) or RC(M)-L models from 1 to N dimensions. They fit the models efficiently by using scores from the previous model as starting values for the next one.

Usage

anoas(tab, nd = 3, symmetric = FALSE, diagonal = FALSE, ...)

anoasL(tab, nd = 3, layer.effect = c("homogeneous.scores", "heterogeneous", "none"), symmetric = FALSE, diagonal = c("none", "heterogeneous", "homogeneous"), ...)

Arguments

tab

a two-way table, or an object (such as a matrix) that can be coerced into a table; if present, dimensions above two will be collapsed as appropriate.

nd

the number of dimensions to include in the most complex model. Cannot exceed min(nrow(tab) - 1, ncol(tab) - 1) if symmetric is FALSE (saturated model), and twice this threshold otherwise (quasi-symmetry model).

symmetric

See rc or rcL

layer.effect

See rcL.

diagonal

See rc or rcL.

more arguments to be passed to rc or rcL.

Value

A list of gnm objects. The first element is the independence model, the remaining ones are rc (for anoas) or rcL (for anoasL) objects with dimensions from 1 to nd.

Details

Contrary to most analyses of association in the literature, this function currently does not fit uniform association model (“U”), nor separate models with only row and column association (“R” and “C” models), nor log-linear row and column association models.

Currently, no significance test is performed on the models. Please note that it is not correct to test the one-dimension association model against the independence model.

References

Wong, R.S-K. (2010). Association models. SAGE: Quantitative Applications in the Social Sciences.

See Also

rc, rcL, gnm

Examples

Run this code
# NOT RUN {
  ## Wong (2010), Table 2.6
  data(gss8590)

  # The table used in Wong (2010) is not perfectly consistent
  # with that of Wong (2001)
  tab <- margin.table(gss8590[,,c(2,4)], 1:2)
  tab[2,4] <- 49

  # Results correspond to lines 1, 6 and 11
  results <- anoas(tab, nd=2)
  results

  
# }

Run the code above in your browser using DataCamp Workspace