est_sampleSize: Estimation sample size based on percentage provided by user.

View source: R/sampling_utils.R

est_sampleSizeR Documentation

Estimation sample size based on percentage provided by user.

Description

Estimation sample size based on percentage provided by user.

Usage

est_sampleSize(
  perc,
  start_date,
  end_date,
  art_init,
  departure,
  diag_info,
  tm,
  location = "region",
  IncludeOnART = TRUE
)

Arguments

perc

Percentage of the population to be sampled: Numbers should be between 0 and 1.

start_date

Start date for sampling times in decimal year.

end_date

End date for sampling times in decimal year.

art_init

Dataframe of IDs and time each ID initiated antiretroviral treatment (ART). Time must be in decimal year.

departure

Dataframe of IDs and their time of departure. Time must be in decimal year.

diag_info

Dataframe of IDs and their time of diagnosis. Time must be in decimal year.

tm

Transmission matrix of who transmitted to whom.

location

Character of location at time of transmission to get IDs to sample from. Location can take the value of "region" or "global".

IncludeOnART

It can take the value of TRUE or FALSE. If TRUE will include diagnosed, active and on or not on ART. If FALSE will include only diagnosed, active and not on ART.

Details

This function will estimate the sample size based on a percentage (0 to 1) provided by the user. This sample size will be the average of total individuals (e.g., diagnosed, active, not on ART) in the start and end points of the sampling dates. To carry out our analyses, we used a sampling strategy to sample time of sequencing just to mimic real HIV studies. However, we can only sample diagnosed and active (and on ART) individuals, it is hard to estimate the exact number of individuals based on the sampling times that will be randomly sampled.

Value

scalar of number of individuas to sample based on percentage


thednainus/HIVepisimAnalysis documentation built on Sept. 21, 2023, 7:32 a.m.