nsum.simulate: Simulate NSUM Data

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function simulates data from one of the four NSUM models.

Usage

1
nsum.simulate(n, known, unknown, N, model = "degree", ...)

Arguments

n

a non-negative integer, the number respondents in the sample.

known

a vector of positive numbers, the sizes of known subpopulations.

unknown

a vector of positive numbers, the sizes of unknown subpopulations.

N

a positive number, the (known) total population size.

model

a character string, the model to be simulated from. This must be one of "degree", "barrier", "transmission", or "combined", with default "degree".

...

additional arguments to be passed to methods, such as starting values, prior parameters, and tuning parameters. Many methods will accept the following arguments:

mu

a real number, the location parameter for the log-normal distribution of network degrees, with default 5.

sigma

a positive number, the scale parameter for the log-normal distribution of network degrees, with default 1.

rho

a vector of numbers between 0 and 1 with length equal to the total number of subpopulations, known and unknown, the dispersion parameters for the barrier effects, with defaults 0.1.

tauK

a vector of numbers between 0 and 1 with length equal to the total number of unknown subpopulations, the multipliers for the transmission biases, with defaults 1.

Details

The function nsum.simulate allows for the simulation of data from a random degree model based upon the Network Scale Up Method (NSUM). Options allow for the inclusion of barrier and transmission effects, both separately and combined, resulting in four models altogether. Each call to the function results in the simulation of a single realization of data.

Value

A list with two components:

y

a matrix of non-negagtive integers, the (i,k)-th entry represents the number of people that the i-th individual knows from the k-th subpopulation with the columns representing known subpopulations coming before the columns representing unknown subpopulations.

d

a vector of positive numbers, the network degrees of the individuals. Only the integer parts were used for simulation.

Author(s)

Rachael Maltiel and Aaron J. Baraff

Maintainer: Aaron J. Baraff <ajbaraff at uw.edu>

References

Maltiel, R., Raftery, A. E., McCormick, T. H., and Baraff, A. J., "Estimating Population Size Using the Network Scale Up Method." CSSS Working Paper 129. Retrieved from https://www.csss.washington.edu/Papers/2013/wp129.pdf

See Also

nsum.mcmc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## load data
data(McCarty)

## simulate from model with barrier effects
sim.bar <- with(McCarty, nsum.simulate(100, known, unknown, N, model="barrier", 
                                       mu, sigma, rho))

## simulate from model with both barrier effects and transmission biases
sim.comb <- with(McCarty, nsum.simulate(100, known, unknown, N, model="combined",
                                        mu, sigma, rho, tauK))

## extract data for use in MCMC
dat.bar <- sim.bar$y

## view degree distribution
hist(sim.bar$d)

NSUM documentation built on May 2, 2019, 9:28 a.m.