Learn R Programming

ergm.ego (version 0.6.1)

ergm.ego: Inference for Exponential-Family Random Graph Models based on Egocentrically Sampled Data

Description

A wrapper around the ergm to fit an ERGM to an egodata object.

Usage

ergm.ego(
  formula,
  popsize = 1,
  offset.coef = NULL,
  ...,
  control = control.ergm.ego(),
  na.action = na.fail,
  do.fit = TRUE
)

Arguments

formula

An formula object, of the form e ~ <model terms>, where e is a egodata object. See ergm for details and examples.

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

popsize

The size \(|N|\) of the finite population network from which the egocentric sample was taken; only affects the shift in the coefficients of the terms modeling the overall propensity to have ties. Setting it to 1 (the default) essentially uses the \(-\log |N'|\) offset on the edges term.

offset.coef

A vector of coefficients for the offset terms.

Additional arguments passed to ergm.

control

A control.ergm.ego control list.

na.action

How to handle missing actor attributes in egos or alters, when the terms need them.

do.fit

Whether to actually call ergm

Value

An object of class ergm.ego inheriting from ergm, with the following additional or overridden elements:

"v"

Variance-covariance matrix of the estimate of the sufficient statistics

"m"

Estimate of the sufficient statistics

"egodata"

The egodata object passed

"popsize"

Population network size used

"ppopsize"

Pseudopopulation size used, see control.ergm.ego

"coef"

The coefficients, along with the network size adjustment netsize.adj coefficient.

"covar"

Pseudo-MLE estimate of the variance-covariance matrix of the parameter estimates under repeated egocentric sampling

"ergm.covar"

The variance-covariance matrix of parameter estimates under the ERGM superpopulation process (without incorporating sampling).

"DtDe"

Estimated Jacobian of the expectation of the sufficient statistics with respect to the model parameters

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). http://niasra.uow.edu.au/publications/UOW190187.html

Examples

Run this code
# NOT RUN {
data(faux.mesa.high)
fmh.ego <- as.egodata(faux.mesa.high)

head(fmh.ego)

egofit <- ergm.ego(fmh.ego~edges+degree(0:3)+nodefactor("Race")+nodematch("Race")
                         +nodefactor("Sex")+nodematch("Sex")+absdiff("Grade"), 
                          popsize=network.size(faux.mesa.high))

# Run convergence diagnostics
mcmc.diagnostics(egofit)

# Estimates and standard errors
summary(egofit)

# Note that we recover the ergm() parameters
# }
# NOT RUN {
coef(ergm(faux.mesa.high~edges+degree(0:3)+nodefactor("Race")+nodematch("Race")
                         +nodefactor("Sex")+nodematch("Sex")+absdiff("Grade"),
          eval.loglik=FALSE))
# }
# NOT RUN {
rbind(c(0, -0.8407, 2.3393, 1.4686, 0.6323, 0.5287, -1.3603, -1.0454,
        -2.4998, -0.7207, 0.833, -0.1823, 0.6357, -1.3513),
      coef(egofit))

# }

Run the code above in your browser using DataLab