makeRdsSample: Generate a synthetic (simulated) RDS sample.

Description Usage Arguments Value Note References See Also Examples

View source: R/simulator.R

Description

Generates a sample from the sampling process assumed in the reference. Well, actually, only the sufficient statistics required by Estimate.b.k are returned.

Usage

1
makeRdsSample(N.k, b.k, sample.length)

Arguments

N.k

An integer vector with the population frequency of each degree.

b.k

A numeric vector of the sampling rates of each degree.

sample.length

The length of the sample. Specified as the number of recruitees before termination.

Value

An object of class rds-object suitable for applying Estimate.b.k.

Note

The simulator does not prodice a whole RDS sample, but rather the sufficient statistics required for applying Estimate.b.k.

References

[1] Berchenko, Y., Rosenblatt J.D., and S.D.W. Frost. "Modeling and Analyzing Respondent Driven Sampling as a Counting Process." arXiv:1304.3505

See Also

Estimate.b.k

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Generate data:
true.Nks <- rep(0,100); true.Nks[c(2,100)] <- 1000
theta <- 1e-1
true.log.bks <- rep(-Inf, 100);true.log.bks[c(2,100)] <- theta*log(c(2,100))
sample.length <- 1000L
rds.simulated.object <- makeRdsSample(
  N.k =true.Nks , 
  b.k = exp(true.log.bks),
  sample.length = sample.length)

# Estimate:
Estimate.b.k(rds.object = rds.simulated.object )
chords:::compareNkEstimate(rds.simulated.object$estimates$Nk.estimates, true.Nks)

chords documentation built on May 30, 2017, 3:39 a.m.

Related to makeRdsSample in chords...