Learn R Programming

networkreporting (version 0.1.1)

kp.estimator_: Average personal network size estimates using known population method

Description

If given attribute.names, then this function produces estimated average network sizes given by the groups that are defined by all combinations of the attributes; otherwise, it estimates the average personal network size for the entire frame population.

Usage

kp.estimator_(resp.data, known.populations, attribute.names, weights, total.kp.size = NULL, alter.popn.size = NULL)
kp.estimator(resp.data, known.populations, attribute.names, weights, total.kp.size = 1, alter.popn.size = NULL)

Arguments

resp.data
the dataframe that has the survey responses
known.populations
the names of the columns in resp.data that have respondents' reports about connections to known populations
attribute.names
the names of the columns in resp.data that determine the subgroups for which average degree is estimated
weights
weights to use in computing the estimate
total.kp.size
the size of the probe alters; i.e., the sum of the known population sizes. if NULL, then this is set to 1
alter.popn.size
the size of the population of alters; this is most often the frame population, which is the default if nothing else is specified; the size of the frame population is taken to be the sum of the weights over all of resp.data

Value

the estimated average degree for respondents in each of the categories given by attribute.names

Technical note

The estimated average degree is $(\sum y_{F_\alpha, A} / N_A) \times N_F / N_{F_\alpha}$ here, we estimate $N_F / N_{F_\alpha}$ by dividing the total of all respondents' weights by the sum of the weights for respondents in each cell $\alpha$.

TODO

  • handle case where attribute.names is NULL (should compute overall average)
  • handle missing values
  • integrate the individual-level estimator above, kp.degree.estimator
  • finish documentation for NSE version
  • make unit tests
  • think about how to elegantly add options for dbar_(P,Q) vs dbar_(Q,P)