ergmx.N#
- ergmx.N(formula, lm=None, subset=None, weights=None, contrasts=None, offset=None, label=None)[source]#
Evaluate
formulaon each network ofergmx.Networks(), as ergm.multi’s N(): with the defaultlm, the statistics are sums over the networks.lmis a one-sided linear model over network-level attributes, in R syntax:"~log(n)","~I(n <= 3) + weekday","~0 + factor(.NetworkID)". Each term’s coefficient in a network is the linear model’s prediction:N(~edges, lm=~log(n))givesN(1)~edgesandN(log(n))~edges, the intercept and slope of the edges coefficient in the network size. The attributes are each network’s graph attributes,n(its number of vertices),.NetworkIDand.NetworkName. In a formula string:"N(~edges + gwesp(0.5, fixed=TRUE), lm=~log(n))".subsetkeeps some networks only: an R expression of their attributes ("~n >= 4"), logical values (recycled) or 1-based indices; the others contribute nothing to the terms, and the linear model’s factor levels are those of the kept networks.offsetadds a known amount to every coefficient of the formula in each network (an R expression, such as"~log(n)", or numbers), as dooffset()terms inlm: each statistic then gets an extra statistic,offset1,offset2…, whose coefficient is fixed at 1, as in ergm.multi.labelnames the operator in the statistics’ names (N(label,1)~edges), or, a function of a statistic’s name and a column of the linear model, names them.weightsother than 1 andcontrastsare not supported, as in ergm.multi.