Learn R Programming

ergm.ego (version 0.6.1)

summary_formula.egodata: Calculation of ERGM-style summary statistics for egodata objects.

Description

Used to calculate the specified network statistics inferred from a egodata object.

Usage

# S3 method for egodata
summary_formula(object, ..., basis = NULL, individual = FALSE, scaleto = NULL)

Arguments

object

An ergm-style formula with a egodata object as the LHS.

For a list of currently implemented egocentric terms for the RHS, see ergm.ego-terms.

Not used at this time.

basis

An optional egodata object relative to which the statistics should be calculated.

individual

If FALSE (the default), calculate the estimated per-capita statistics, weighted according to the ego weights, then scale them up to a network of size scaleto.

If TRUE, calculate each ego's individual contribution to the specified network statistics.

scaleto

Size of a hypothetical network to which to scale the statistics. Defaults to the number of egos in the dataset.

Value

If individual==FALSE, a named vector of statistics. If individual==TRUE, a matrix with a row for each ego, giving that ego's contribution to the network statistic.

References

Pavel N. Krivitsky and Martina Morris. Inference for Social Network Models from Egocentrically-Sampled Data, with Application to Understanding Persistent Racial Disparities in HIV Prevalence in the US. Thechnical Report. National Institute for Applied Statistics Research Australia, University of Wollongong, 2015(05-15). 10.1214/16-AOAS1010

Pavel N. Krivitsky, Mark S. Handcock, and Martina Morris. Adjusting for Network Size and Composition Effects in Exponential-Family Random Graph Models. Statistical Methodology, 2011, 8(4), 319-339. 10.1016/j.stamet.2011.01.005

See Also

summary_formula, summary_formula.ergm

Examples

Run this code
# NOT RUN {
data(faux.mesa.high)
fmh.ego <- as.egodata(faux.mesa.high)
(nw.summ <- summary(faux.mesa.high~edges+degree(0:3)+nodematch("Race")+
                    nodematch("Sex")+absdiff("Grade")+nodemix("Grade")))

(ego.summ <- summary(fmh.ego~edges+degree(0:3)+nodematch("Race")+nodematch("Sex")+
                     absdiff("Grade")+nodemix("Grade"),
                     scaleto=network.size(faux.mesa.high)))

stopifnot(isTRUE(all.equal(nw.summ,ego.summ)))

# }

Run the code above in your browser using DataLab