Sum-ergmTerm-fe08cb7f: A sum (or an arbitrary linear combination) of one or more...

Sum-ergmTermR Documentation

A sum (or an arbitrary linear combination) of one or more formulas

Description

This operator sums up the RHS statistics of the input formulas elementwise.

Usage

# binary: Sum(formulas, label)

# valued: Sum(formulas, label)

Arguments

formulas

a list (constructed using list() or c()) of ergm()-style formulas whose RHS gives the statistics to be evaluated, or a single formula.

If a formula in the list has an LHS, it is interpreted as follows:

  • a numeric scalar: Network statistics of this formula will be multiplied by this.

  • a numeric vector: Corresponding network statistics of this formula will be multiplied by this.

  • a numeric matrix: Vector of network statistics will be pre-multiplied by this.

  • a character string: One of several predefined linear combinations. Currently supported presets are as follows:

    • "sum" Network statistics of this formula will be summed up; equivalent to matrix(1,1,p) , where p is the length of the network statistic vector.

    • "mean" Network statistics of this formula will be averaged; equivalent to matrix(1/p,1,p) , where p is the length of the network statistic vector.

label

used to specify the names of the elements of the resulting term sum vector. If label is a character vector of length 1, it will be recycled with indices appended. If a function is specified, formulas parameter names are extracted and their list of character vectors is passed label.

Details

Note that each formula must either produce the same number of statistics or be mapped through a matrix to produce the same number of statistics.

A single formula is also permitted. This can be useful if one wishes to, say, scale or sum up the statistics returned by a formula.

Offsets are ignored unless there is only one formula and the transformation only scales the statistics (i.e., the effective transformation matrix is diagonal).

Curved models are supported, subject to some limitations. In particular, the first model's etamap will be used, overwriting the others. If label is not of length 1, it should have an attr -style attribute "curved" specifying the names for the curved parameters.

See Also

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

\Sexpr[results=rd,stage=render]{ergm:::.formatTermKeywords("ergmTerm", "Sum", "subsection")}

ergm documentation built on Oct. 7, 2024, 5:08 p.m.