Description Usage Arguments References Examples
Simulates referral chains/trees for Respondent-driven sampling
1 2 |
adjList |
is the object |
referral.type |
referral type. It can be "sRW", simple random walk, or "acRW", anti-cluster random walk. |
wRreplacement |
if TRUE, then the referral chain/tree will be collected with replacement. |
nSamples |
number of samples to be collected. |
nReferrals |
number of referral per participant (or node) |
seedNode |
the starting seed participant (or node). |
rseed |
random seed for random number generators inside the code. It is useful for reproducing results. |
Khabbazian, Mohammad, Bret Hanlon, Zoe Russek, and Karl Rohe. "Novel sampling design for respondent-driven sampling." Electronic Journal of Statistics 11, no. 2 (2017): 4769-4812.'
1 2 3 4 5 6 7 8 9 10 11 12 | generate.network <- function(N,con){
A <- matrix(0,ncol=N,nrow=N) # initialize with zeros
A[upper.tri(A)] <- rbinom(N*(N-1)/2,1,con) # fill up the upper triangle
A[lower.tri(A)] <- t(A)[lower.tri(A)] # fill up the lower triangle to obtain a symmetric matrix
A
}
ER <- generate.network(300,0.6)
adjL <- adj2list(ER)
res <- rdssim(adjL, referral.type="sRW", wRreplacement = T,
nSamples=100, nReferrals=3, seedNode=10, rseed=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.