statistics: Compute Statistics

View source: R/statistics.R

statisticsR Documentation

Compute Statistics

Description

Computes statistics.

Usage

statistics(formula)

Arguments

formula

A model 'formula' object. The left-hand side should be the name of a iglm.data object available in the calling environment. Alternatively, the left-hand side can be a iglm.data.list object to compute statistics for multiple iglm.data objects at once (is, e.g., the normal outcome of all simulations). See iglm-terms for details on specifying the right-hand side terms.

Value

A named numeric vector. Each element corresponds to a term in the 'formula', and its value is the calculated observed feature for that term based on the data in the iglm.data object. The names of the vector match the coefficient names derived from the formula terms.

Examples

# Create a iglm.data object
n_actor <- 10
neighborhood <- matrix(1, nrow = n_actor, ncol = n_actor)
type_x <- "binomial"
type_y <- "binomial"
x_attr_data <- rbinom(n_actor, 1, 0.5)
y_attr_data <- rbinom(n_actor, 1, 0.5)
z_net_data <- matrix(0, nrow = n_actor, ncol = n_actor)
object <- iglm.data(
  z_network = z_net_data, x_attribute = x_attr_data,
  y_attribute = y_attr_data, neighborhood = neighborhood,
  directed = FALSE, type_x = type_x, type_y = type_y
)
statistics(object ~ edges(mode = "local") + attribute_y + attribute_x)

iglm documentation built on April 23, 2026, 5:07 p.m.