add.kp: attach known populations to a dataframe

Description Usage Arguments Details Value See Also Examples

Description

take a known population vector (see df.to.kpvec) and associate it with a survey dataframe. this makes it more convenient to use some of the networksampling package's function

Usage

1
add.kp(survey.data, kp.vec, total.pop.size = NULL)

Arguments

survey.data

the survey dataframe

kp.vec

the known population vector

total.pop.size

(optional) the total population size to use (see below)

Details

The total.popn.size parameter is interpreted as follows:

Value

the survey dataframe with the known population vector attached as an attribute

See Also

df.to.kpvec

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

  # if kp.dat is a dataframe with columns 'kp' with known popn names
  # and 'total.size' with the total size,
  # and my.survey is the dataframe with survey responses

  my.kp.vec <- df.to.kpvec(kp.data, kp.var='kp', kp.value='total.size')
  my.survey <- add.kp(my.survey, my.kp.vec)

  # now we can call estimator functions like
  # kp.degree.estimator without having to specify known
  # populations each time

## End(Not run)

networkreporting documentation built on May 2, 2019, 1:52 p.m.