statnet / ergm.ego

Fit, Simulate and Diagnose Exponential-Family Random Graph Models to Egocentrically Sampled Network Data https://statnet.org
Other
14 stars 4 forks source link

Add support for more complex survey designs #6

Closed krivit closed 3 years ago

krivit commented 7 years ago

Currently, egodata objects have an element egoWt which can be used to specify sampling weights (up to a constant), which are then used to compute $\bar{h}$, etc., and a variety of ways to compute the variance-covariance matrix (incl. bootstrap and jackknife). From there, Delta method yields the variance-covariance matrix of $\hat{\theta}$.

I should be straightforward to incorporate existing functionality for survey sampling: the only places that would be affected would be:

krivit commented 7 years ago

In particular, R survey package has a svydesign type and svymean() function that computes estimates for population means, and their variance-covariance matrices, using a variety of methods.

A simple improvement might be that egoWt argument to egodata becomes design, and instead of a vector of weights, the user can pass a svydesgin object. ergm.ego could then outsource the point estimation and the variance-covariance matrix calculation to svymean().

However, this means that support for nonscaling (e.g., mean age of a relationship) terms is not as straightforward, though survey seems to have some built-in support for jackknife and bootstrap.

handcock commented 7 years ago

I strongly advise using the using the svydesign class for it and the survey package. It is easy to make, has a lot of functionality and is a standard.

krivit commented 3 years ago

This has been achieved with egor.