degrees: Outdegree and indegrees

Description Usage Arguments Details Value Author(s) Examples

View source: R/rda.R

Description

Calculation of the outdegrees and indegrees of a sociomatrix.

Usage

1
degrees(Y, dichotomize = TRUE)

Arguments

Y

(matrix) The sociomatrix.

dichotomize

(logical) If true, converts any non-zero entries of Y to 1 for calculation of the degrees.

Details

The outdegree of a binary sociomatrix may be defined as the row sums of the non-diagonal elements of the sociomatrix. If the relations are valued, then the outdegree may be defined as either the outdegree of of a dichotomized version of the sociomatrix (dichotomize=TRUE), or as the row sums of the original sociomatrix (dichotomize=FALSE). Note that if non-diagonal elements of a row are missing, the degree for that row is missing as well. The indegrees are computed analogously.

Value

A list consisting of the row degrees (rdeg) and the column degrees (cdeg).

Author(s)

Peter Hoff

Examples

1
2
3
4
data(conflict90s)
# For valued relations, 'dochotomize' makes a difference
degrees(conflict90s$conflicts)
degrees(conflict90s$conflicts,dichotomize=TRUE)

MikeKozelMSU/mcmcFunc documentation built on May 22, 2019, 5:31 p.m.