Closed krivit closed 3 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.
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.
This has been achieved with egor
.
Currently,
egodata
objects have an elementegoWt
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:
egodata
type, which would need to save the sampling design information.ergm.ego
's calculation of $\bar{h}$ and its variance-covariance matrix.