Learn R Programming

ergm (version 3.9.4)

summary_formula: Dispatching a summary function based on the class of the LHS of a formula.

Description

The generic summary_formula() (note the underscore) expects a formula argument and will attempt to identify the class of the LHS of the formula and dispatch to the appropriate summary_formula method.

Usage

summary_formula(object, ..., basis = NULL)

# S3 method for ergm summary_formula(object, ..., basis = NULL)

# S3 method for network.list summary_formula(object, response = NULL, ..., basis = NULL)

# S3 method for network summary_formula(object, response = NULL, ..., basis = NULL)

# S3 method for matrix summary_formula(object, response = NULL, ..., basis = NULL)

# S3 method for default summary_formula(object, response = NULL, ..., basis = NULL)

Arguments

object

A two-sided formula.

further arguments passed to or used by methods.

basis

Optional object of the same class as the LHS of the formula, substituted in place of the LHS.

response

Name of the edge attribute whose value is to be modeled. Defaults to NULL for simple presence or absence, modeled via binary ERGM terms. Passing anything but NULL uses valued ERGM terms.

Value

A vector of statistics measured on the network.

Methods (by class)

  • ergm: an ergm fit method, extracting its model from the fit.

  • network.list: a method for a network.list on the LHS of the formula.

  • network: a method for a network on the LHS of the formula.

  • matrix: a method for a matrix on the LHS of the formula.

  • default: a fallback method.

See Also

ergm(), network(), ergm-terms

summary.ergm_model()

Examples

Run this code
# NOT RUN {
#
# Lets look at the Florentine marriage data
#
data(florentine)
#
# test the summary_formula function
#
summary(flomarriage ~ edges + kstar(2))
m <- as.matrix(flomarriage)
summary(m ~ edges)  # twice as large as it should be
summary(m ~ edges, directed=FALSE) # Now it's correct

# }

Run the code above in your browser using DataLab