
Generate stool adequacy columns in the AFP dataset
generate_stool_data.RdThe function adds the adequacy final column called adequacy.final and adequacy.final2 into the AFP linelist. The function borrows
in part from f.stool.ad.01(), so that the adequacy final column generated can match with how the stool adequacy
function treats bad or missing data and classify the adequacy final column. adequacy.final contains the original
classification of the sample and adequacy.final2 contains the final classification according to how missing and bad
data are treated.
Usage
generate_stool_data(
afp.data,
start_date,
end_date,
missing = "good",
bad.data = "inadequate"
)Arguments
- afp.data
tibbleAFP linelist. Eitherctry.data$afp.all.2- start_date
strStart date of the analysis.- end_date
strEnd date of the analysis.- missing
strHow to treat missing data. Valid values are:"good", "bad", "remove". Defaults to"good". When calculating theadequacy.finalcolumn:"good"usesadequacy.03"bad"usesadequacy.01"exclude"usesadequacy.02
- bad.data
strHow to treat bad data. Valid values are:"remove", "inadequate". Defaults to"inadequate"."inadequate"treats samples with bad data as inadequate.
Details
Unlike the stool adequacy function, this will not filter out NOT-AFP cases, as it is expected for other functions
that use the output of this function to do the filtering. For example, generate_60_day_table_data().
Examples
if (FALSE) { # \dontrun{
raw.data <- get_all_polio_data(attach.spatial.data = FALSE)
stool.data <- generate_stool_data(raw.data$afp, "2021-01-01", "2023-12-31")
} # }