ergm.formula.utils {ergm}R Documentation

Internal Functions for Querying, Validating and Extracting from ERGM Formulas

Description

These are all functions that are generally not called directly by users, but may be employed by other depending packages.

Usage

ergm.getmodel(formula, nw, response = NULL, silent = FALSE, role = "static", ...)

ergm.getnetwork(form, loopswarning = TRUE)

ergm.getterms(formula)

ergm.update.formula(object, new, ..., from.new = FALSE)

term.list.formula(rhs, sign = +1)

offset.info.formula(object, response = NULL) 

remove.offset.formula(object, response = NULL)

append.rhs.formula(object, newterms, keep.onesided = FALSE)

Arguments

formula

a formula of the form network ~ model.term(s)

nw

the network of interest

response

charcter, name of edge attribute containing edge weights

silent

logical, whether to print the warning messages from the initialization of each model term; default=FALSE

role

A hint about how the model will be used. Used primarily for dynamic network models.

...

additional parameters for model formulation

form

same as formula, a formula of the form 'network ~ model.term(s)'

loopswarning

whether warnings about loops should be printed (T or F);default=TRUE

object

formula object to be updated

new

new formula to be used in updating

from.new

logical or character vector of variable names. controls how environment of formula gets updated.

rhs

a formula-style call containing the right hand side of formula, obtained by fmla[[3]] for a two-sided formula and fmla[[2]] for a one-sided formula.

sign

an internal parameter used by term.list.formula when calling itself recursively

newterms

list of terms (names) to append to the formula

keep.onesided

if the initial formula is one-sided, keep it whether to keep it one-sided or whether to make the initial formula the new LHS

Details

Value

ergm.getmodel returns a 'model.ergm' object as a list containing:

ergm.getnetwork returns:

ergm.getterms returns:

terms.list.formula returns a list of formula terms, each of witch having an additional attribute "sign".

ergm.update.formula, remove.offset.formula and append.rhs.formula each return an updated formula object

Examples

## append.rhs.formula

append.rhs.formula(y~x,list(as.name("z1"),as.name("z2"))) # y~x+z1+z2
append.rhs.formula(~y,list(as.name("z"))) # y~z
append.rhs.formula(~y+x,list(as.name("z"))) # y+x~z
append.rhs.formula(~y,list(as.name("z")),TRUE) # ~y+z

[Package ergm version 3.4.0 Index]