mixingmatrix.egor function

Summarizing the mixing among groups in an egocentric dataset

Summarizing the mixing among groups in an egocentric dataset

A mixingmatrix method for egor objects, to return counts of how often a ego of each group nominates an alter of each group.

## S3 method for class 'egor' mixingmatrix( object, attrname, useNA = c("ifany", "no", "always"), rowprob = FALSE, weight = TRUE, ... )

Arguments

  • object: A egor object.

  • attrname: A character vector containing the name of the network attribute whose mixing matrix is wanted.

  • useNA: One of "ifany", "no" or "always", interpreted as in table(). By default (useNA = "ifany") if there are any NAs on the attribute corresponding row and

    column will be contained in the result. See Details.

  • rowprob: Whether the counts should be normalized by row sums. That is, whether they should be proportions conditional on the ego's group.

  • weight: Whether sampling weights should be incorporated into the calculation (TRUE, the default) or ignored (FALSE).

  • ...: Additional arguments, currently unused.

Returns

A matrix with a row and a column for each level of attrname.

Note that, unlike network::mixingmatrix(), what is counted are nominations, not ties. This means that under an egocentric census, the diagonal of mixingmatrix.egor will be twice that returned by network::mixingmatrix() for the original undirected network.

Examples

data(faux.mesa.high) fmh.ego <- as.egor(faux.mesa.high) (mm <- mixingmatrix(faux.mesa.high,"Grade")) (mm.ego <- mixingmatrix(fmh.ego,"Grade"))

See Also

network::mixingmatrix(), nodemix ERGM term, summary method for egocentric data

  • Maintainer: Pavel N. Krivitsky
  • License: GPL-3 + file LICENSE
  • Last published: 2025-02-12