R: Wrap binary terms for use in valued models

B-ergmTerm {ergm} | R Documentation

## Wrap binary terms for use in valued models

### Description

Wraps binary `ergm` terms for use in valued models, with `formula` specifying which terms are to be wrapped and `form` specifying how they are to be used and how the binary network they are evaluated on is to be constructed.

### Usage

    # valued: B(formula, form)

### Arguments

`formula` | a one-sided `ergm()`-style formula whose RHS contains the binary ergm terms to be evaluated. Which terms may be used depends on the argument `form`
`form` | One of three values: `"sum"`: see section "Generalizations of binary terms" in `ergmTerm` help; all terms in `formula` must be dyad-independent. `"nonzero"`: section "Generalizations of binary terms" in `ergmTerm` help; any binary `ergm` terms may be used in `formula` . a one-sided formula value-dependent network. `form` must contain one "valued" `ergm` term, with the following properties: dyadic independence; dyadwise contribution of either 0 or 1; and dyadwise contribution of 0 for a 0-valued dyad. Formally, this means that it is expressable as sum[i,j] f[i,j] (y[i,j]), where for all i, j, and y, f_{i,j}(y_{i,j}) is either 0 or 1 and, in particular, f[i,j] (0)=0. Examples of such terms include `nonzero` , `ininterval()` , `atleast()` , `atmost()` , `greaterthan()` , `lessthen()` , and `equalto()` . Then, the value of the statistic will be the value of the statistics in `formula` evaluated on a binary network that is defined to have an edge if and only if the corresponding dyad of the valued network adds 1 to the valued term in `form` .

### Details

For example, `B(~nodecov("a"), form="sum")` is equivalent to `nodecov("a", form="sum")` and similarly with `form="nonzero"` .

When a valued implementation is available, it should be preferred, as it is likely to be faster.

### See Also

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

[Package ergm version 4.2.1 Index]