Type: Package
Title: RDS Sample Size Estimation and Power Calculation
Version: 0.5.0
Maintainer: Yibo Wang <wangyb@umich.edu>
Description: Provides functionality for carrying out sample size estimation and power calculation in Respondent-Driven Sampling.
License: GPL-3
Depends: R (≥ 3.6.2)
Imports: Rcpp
LinkingTo: Rcpp
Encoding: UTF-8
RoxygenNote: 7.2.0
NeedsCompilation: yes
Packaged: 2023-08-15 14:35:57 UTC; wangyb
Author: Yibo Wang [aut, cre], Michael R. Elliott [aut], Sunghee Lee [aut]
Suggests: knitr, rmarkdown, dplyr, ggplot2, latex2exp, microbenchmark
VignetteBuilder: knitr
Repository: CRAN
Date/Publication: 2023-08-15 15:00:02 UTC

Calculating the accumulated sample size distribution by each wave.

Description

Calculating the accumulated sample size distribution by each wave.

Usage

calSize(s, c, maxWave, rr, bruteMC, tol = 0.025)

Arguments

s

scalar; Number of seeds to initiate the sampling process.

c

scalar; Number of coupons issued to each participant.

maxWave

scalar; Planned field period scaled by wave, which does not include the initial round of recruiting seeds.

rr

scalar or vector; a (constant) recruitment rate or a vector of length maxWave, listing varying recruitment rates at each wave. The recruitment rate represents the average coupon use rate. For example, if rr is a vector, the wth element is the ratio of the number of successful recruits brought into the study at wave w by their recruiters (participants from wave w-1) to the total number of coupons issued to those recruiters, where w ranges from 1 to maxWave. Seeds are counted as participants at Wave 0.

bruteMC

logical; If TRUE then use a brute force Monte Carlo approach to obtain empirical data and estimate sample size distribution; If FALSE then compute the theoretical results of sample size distribution using an approximation algorithm.

tol

scalar; Accuracy loss limit control, which is set up for the approximation algorithm when bruteMC=FALSE, with default of 0.025. This parameter determines the acceptable level of accuracy loss in the approximate computation of the sample size distribution.

Value

a list consisting of the following elements:

Pr_Extinction_list

vector; a vector of extinction probabilities, i.e., probability of not recruiting any new participants at each wave.

Pr_Size_by_Wave_w

list; probability mass function and complementary cumulative distribution function of attaining a certain sample size (including seeds) by each wave, w=1,...,maxWave. The round of seed collection is counted as wave 0.

References

Raychaudhuri, Samik. Introduction to monte carlo simulation, 2008 Winter simulation conference. IEEE, 2008.

Examples

x <- calSize(s=10,c=3,maxWave=9,rr=0.3,bruteMC=FALSE,tol=0.025)


Summarizing the sample size estimation.

Description

Summarizing the sample size estimation.

Usage

nprobw(x, n)

Arguments

x

an object class of "RDSsamplesize", results of estimated sample size distribution of a call to 'calSize'.

n

integer; target sample size.

Value

a table presenting the probability of the accumulated sample size (including seeds) reaching at least n by each wave, w=1,..., maxWave

Examples

x <- calSize(s=10,c=3,maxWave=9,rr=0.3,bruteMC=FALSE,tol=0.025)
nprobw(x,n=100)