calSize {RDSsamplesize} | R Documentation |
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)