Package 'ergm.rank'

Title: Fit, Simulate and Diagnose Exponential-Family Models for Rank-Order Relational Data
Description: A set of extensions for the 'ergm' package to fit weighted networks whose edge weights are ranks. See Krivitsky and Butts (2017) <doi:10.1177/0081175017692623> and Krivitsky, Hunter, Morris, and Klumb (2023) <doi:10.18637/jss.v105.i06>.
Authors: Pavel N. Krivitsky [aut, cre] (ORCID: <https://orcid.org/0000-0002-9101-3362>), Carter T. Butts [ctb], Mark S. Handcock [ctb], David R. Hunter [ctb]
Maintainer: Pavel N. Krivitsky <[email protected]>
License: GPL-3 + file LICENSE
Version: 4.1.2-1575
Built: 2026-05-21 10:57:31 UTC
Source: https://github.com/statnet/ergm.rank

Help Index


Fit, Simulate and Diagnose Exponential-Family Models for Rank-Order Relational Data

Description

ergm.rank is a set of extensions to package ergm to fit and simulate from exponential-family random graph models for networks whose edge weights are ranks.

Details

Mainly, it implements the CompleteOrder reference measure for valued ERGMs (Krivitsky 2012; Krivitsky et al. 2023) and provides some rank-order change statistics (search.ergmTerms("ordinal") for a list) (Krivitsky and Butts 2017).

When publishing results obtained using this package, please cite the original authors as described in citation(package="ergm.rank").

All programs derived from this package must cite it.

This package contains functions specific to using ergm() to model networks whose dyad values are ranks. Examples include preferences, valued ties reduced to ranks, etc.. These terms have a specialized interpretation, and are therefore generally prefixed by "rank.", though they should take any valued data.

For detailed information on how to download and install the software, go to the Statnet project website: https://statnet.org. A tutorial, support newsgroup, references and links to further resources are provided there.

Author(s)

Maintainer: Pavel N. Krivitsky [email protected] (ORCID)

Other contributors:

References

Krivitsky PN (2012). “Exponential-family Random Graph Models for Valued Networks.” Electronic Journal of Statistics, 6, 1100–1128. doi:10.1214/12-EJS696.

Krivitsky PN, Butts CT (2017). “Exponential-family Random Graph Models for Rank-order Relational Data.” Sociological Methodology, 47(1), 68–112. doi:10.1177/0081175017692623.

Krivitsky PN, Hunter DR, Morris M, Klumb C (2023). “ergm 4: New Features for Analyzing Exponential-Family Random Graph Models.” Journal of Statistical Software, 105(6), 1–44. doi:10.18637/jss.v105.i06.

See Also

ergmTerm, ergmReference


A uniform distribution over the possible complete orderings of the alters by each ego

Description

The network must be directed or bipartite, and the ordering of the alters by each ego must be complete, i.e., there must not be any ties.

Usage

# CompleteOrder

See Also

ergmReference for index of reference distributions currently visible to the package.

Keywords

None


Newcomb's Fraternity Networks

Description

These 14 networks record weekly sociometric preference rankings from 17 men attending the University of Michigan in the fall of 1956; Data were collected longitudinally over 15 weeks, although data from week 9 are missing.

Format

A list of 15 networks.

Details

The men were recruited to live in off-campus (fraternity) housing, rented for them as part of the Michigan Group Study Project supervised by Theodore Newcomb from 1953 to 1956. All were incoming transfer students with no prior acquaintance of one another.

The data set, derived from one in the unreleased netdata package, contains a network list newcomb with 14 networks. Each network is complete and contains two edge attributes:

"rank"

the preference of the iith man for the jjth man from 1 through 16, with 1 being the highest preference.

"descrank"

the same, but 1 indicates lowest preference.

Licenses and Citation

If the source of the data set does not specified otherwise, this data set is protected by the Creative Commons License https://creativecommons.org/licenses/by-nc-nd/2.5/.

When publishing results obtained using this data set the original authors should be cited. In addition this should be cited as:

Vladimir Batagelj and Andrej Mrvar (2006): Pajek datasets
https://github.com/bavla/Nets/tree/master/data/Pajek

Source

https://github.com/bavla/Nets/blob/master/data/Pajek/ucinet/README.md

References

See the link above. Newcomb T. (1961). The acquaintance process. New York: Holt, Reinhard and Winston.

Nordlie P. (1958). A longitudinal study of interpersonal attraction in a natural group setting. Unpublished doctoral dissertation, University of Michigan.

White H., Boorman S. and Breiger R. (1977). Social structure from multiple networks, I. Blockmodels of roles and positions. American Journal of Sociology, 81, 730-780.

Examples

# Note: This takes a long time.
data(newcomb)

# Fit a model for the transition between initial (time 0) ranking and
# ranking after one week (time 1). Note that MCMC interval has been
# decreased to save time.
newcomb.1.2.fit <- ergm(newcomb[[2]]~
                        rank.inconsistency(newcomb[[1]],"descrank")+
                        rank.deference+rank.nonconformity("all")+
                        rank.nonconformity("localAND"),
                        response="descrank", reference=~CompleteOrder,
                        control=control.ergm(MCMC.interval=10))
# Check MCMC diagnostics (barely adequate).
mcmc.diagnostics(newcomb.1.2.fit)
summary(newcomb.1.2.fit)

Deference (aversion)

Description

Measures the amount of "deference" in the network: configurations where an ego ii ranks an alter jj over another alter kk, but jj, in turn, ranks kk over ii . A lower-than-chance value of this statistic and/or a negative coefficient implies a form of mutuality in the network.

Usage

# valued: rank.deference

See Also

ergmTerm for index of model terms currently visible to the package.

Keywords

None


Dyadic covariates

Description

Models the effect of a dyadic covariate on the propensity of an ego ii to rank alter jj highly.

Usage

# valued: rank.edgecov(x, attrname)

Arguments

x, attrname

a specification for the dyadic covariate: either one of the following, or the name of a network attribute containing one of the following:

a covariate matrix

with dimensions n×nn \times n for unipartite networks and b×(nb)b \times (n-b) for bipartite networks; attrname, if given, is used to construct the term name.

a network object

with the same size and bipartitedness as LHS; attrname, if given, provides the name of the quantitative edge attribute to use for covariate values (in this case, missing edges in x are assigned a covariate value of zero).

See Also

ergmTerm for index of model terms currently visible to the package.

Keywords

None


(Weighted) Inconsistency

Description

Measures the amount of disagreement between rankings of the focus network and a fixed covariate network x , by couting the number of pairwise comparisons for which the two networks disagree.

Usage

# valued: rank.inconsistency(x, attrname, weights, wtname, wtcenter)

Arguments

x, attrname

a specification for the reference ranking: either one of the following, or the name of a network attribute containing one of the following:

a matrix

with dimensions n×nn \times n for unipartite networks and b×(nb)b \times (n-b) for bipartite networks; attrname, if given, is used to construct the term name.

a network object

with the same size and bipartitedness as LHS; attrname, if given, provides the name of the quantitative edge attribute to use for reference rankings values (in this case, missing edges in x are assigned a rank value of zero).

weights

optional parameter to weigh the counts. Can be either a 3D n×n×nn\times n\times n-array whose (i,j,k)(i,j,k) th element gives the weight for the comparison by ii of jj and kk or a function taking three arguments, ii, jj, and kk, and returning the weight of this comparison.

wtname, wtcenter

If wtcenter=TRUE , the calculated weights will be centered around their mean. wtname can be used to label this term.

See Also

ergmTerm for index of model terms currently visible to the package.

Keywords

None


Attractiveness/Popularity covariates

Description

Models the effect of one or more nodal covariates on the propensity of an actor to be ranked highly by the others.

Usage

# valued: rank.nodeicov(attr)

Arguments

attr

a vertex attribute specification (see Specifying Vertex attributes and Levels (?nodal_attributes) for details.)

See Also

ergmTerm for index of model terms currently visible to the package.

Keywords

None


Nonconformity

Description

Measures the amount of "nonconformity" in the network: configurations where an ego ii ranks an alter jj over another alter kk, but ego ll ranks kk over jj .

Usage

# valued: rank.nonconformity(to, par)

Arguments

to

which controls to whom an ego may conform:

  • "all" (the default): Nonconformity to all egos is counted. A lower-than-chance value of this statistic and/or a negative coefficient implies a degree of consensus in the network.

  • "localAND": Nonconformity of ii to ego ll regarding the relative ranking of jj and kk is only counted if ii ranks ll over both jj and kk . A lower-than-chance value of this statistic and/or a negative coefficient implies a form of hierarchical transitivity in the network. This is the recommended form of local nonconformity (over "local1" and "local2" ).

  • "local1": Nonconformity of ii to ego ll regarding the relative ranking of jj and kk is only counted if ii ranks ll over jj .

  • "local2": Nonconformity of ii to ego ll regarding the relative ranking of jj and kk is only counted if ii ranks ll over kk .

  • "thresholds": Nonconformity of ii to ego ll regarding the relative ranking of jj and kk is only counted if ii ranks ll above par, where par can be a vector with multiple thresholds.

  • "geometric": Nonconformity of ii to ego ll regarding the relative ranking of jj and kk is weighted by par taken to the power of the rank of ll by ii , where par is a scalar.

par

additional parameters for some types of nonconformity.

See Also

ergmTerm for index of model terms currently visible to the package.

Keywords

None