Generates a sample from the sampling process assumed in the reference.
Well, actually, only the sufficient statistics required by
Estimate.b.k are returned.
makeRdsSample(N.k, b.k, sample.length)
An integer vector with the population frequency of each degree.
A numeric vector of the sampling rates of each degree.
The length of the sample. Specified as the number of recruitees before termination.
An object of class
rds-object suitable for applying
The simulator does not prodice a whole RDS sample, but rather the sufficient statistics required for applying
 Berchenko, Y., Rosenblatt J.D., and S.D.W. Frost. "Modeling and Analyzing Respondent Driven Sampling as a Counting Process." arXiv:1304.3505
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.