| ergm.formula.utils {ergm} | R Documentation |
These are all functions that are generally not called directly by users, but may be employed by other depending packages.
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)
formula |
a formula of the form |
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 |
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 |
sign |
an internal parameter used by |
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 |
The ergm.getmodel function parses the given formula, and initiliazes each ergm
term via the InitErgmTerm functions to create a model.ergm object for the
given network
The ergm.getnetwork function ensures that the network in a given formula
is valid; if so, the network is returned; if not, execution is halted with warnings
The ergm.getterms function returns the terms of a given formula and ensures that the formula is indeed a formula with the necessary ~ operator
ergm.update.formula is a reimplementation of update.formula that does not simplify. Note that the resulting formula's environment is set as follows. If
from.new==FALSE, it is set to that of object. Otherwise, a new
sub-environment of object, containing, in addition, variables in new
listed in from.new (if a character vector) or all of new (if TRUE).
term.list.formula returns a list containing terms in a given
formula, handling + and - operators and parentheses,
and keeping track of whether a term has a plus or a minus sign.
offset.info.formula returns the offset vectors associated with a formula.
remove.offset.formula deletes all offset terms in an ERGM formula.
append.rhs.formula appends a list of terms to the RHS of a formula. If the formula is one-sided, the RHS becomes the LHS, if keep.onesided==FALSE (the default).
ergm.getmodel returns a 'model.ergm' object as a list containing:
formula : the formula inputted to ergm.getmodel
coef.names : a vector of coefficient names
offset : a logical vector of whether each term was "offset", i.e. fixed
terms : a list of terms and 'term components' initialized by the
appropriate InitErgmTerm.X function.
network.stats0: NULL always??
etamap : the theta -> eta mapping as a list returned from <ergm.etamap>
class : the character string "model.ergm"
ergm.getnetwork returns:
the network from the formula IF (i) the formula was correctly structured and (ii) the network is found within the formula's enviornment
ergm.getterms returns:
the terms object associated with the formula and returned by the
native R function terms>. see terms.object for details about
the components
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
## 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