samplingP {SimRDS}R Documentation

Extract samples from generated populations.

Description

Extract samples from the generated populations using the 'SimRDS::population' function. Can directly use this output to the RDS estimates in the RDS package.

Usage

samplingP(
  population,
  seeds,
  coupon,
  waves = NULL,
  size = NULL,
  prob = NULL,
  character_sam = NULL,
  showids = TRUE,
  timeInterval = NULL
)

Arguments

population

Population generated using the 'SimRDS::population' function.

seeds

Number of seeds.

coupon

Number of coupons.

waves

Number of waves.

size

Sample size.

prob

Whether the seeds are selected probabilistically. If you want to be selected randomly, leave it as 'NULL' If you want to relate it to a variable, add the variable name. For example, if the seeds selected depend on the network size, then 'network' should be used. It should enter as '1/network' if it is inversely proportional.

character_sam

If the individuals from the network of an individual should be chosen randomly use "NULL". If the selection should be done probabilistically, state the variable and how it should be related. Possible inputs are NULL, netSize, character.

showids

If TRUE, it displays the IDs being recruited.

timeInterval

Days between recruitment waves. Zeroth wave is assumed to recruit at the present day.

Value

RDS sample

Examples


RDS.population <- population(N = 1000,p.ties = 0.6,minVal = 10,zeros = 0,
pr = .5,pa = .1, atype_char = "net",atype_res = "net*char")

RDS.samplingP <- samplingP(population=RDS.population, seeds = 40, coupon = 2,
waves = 8, prob = '1/network', character_sam = 'netSize')


# This function may take considerable time to produce output, depending on
# the computer's performance. For a quick reference to the expected result,
# a saved version of the output is available.
data(RDS.samplingP)


[Package SimRDS version 2.0.0 Index]