Prepare data from a serological survey for modelling
Source:R/seroprevalence_data.R
prepare_serodata.Rd
This function adds the necessary additional variables to the given dataset
serodata
corresponding to a serological survey.
Arguments
- serodata
A data frame containing the data from a serological survey. This data frame must contain the following columns:
survey
survey Label of the current survey
total
Number of samples for each age group
counts
Number of positive samples for each age group
age_min
age_min
age_max
age_max
tsur
Year in which the survey took place
country
The country where the survey took place
test
The type of test taken
antibody
antibody
Alternatively to
age_min
andage_max
, the dataset could already include the age group markerage_mean_f
, representing the middle point betweenage_min
andage_max
. Ifafe_mean_f
is missing, it will be generated by the function.- alpha
probability of a type I error. For further details refer to binconf.
Value
serodata with additional columns necessary for the analysis. These columns are:
age_mean_f
Floor value of the average between age_min and age_max for the age groups delimited by
age_min
andage_max
sample_size
The size of the sample
birth_year
Years in which the subject was born according to the age group marker
age_mean_f
prev_obs
Observed prevalence
prev_obs_lower
Lower limit of the confidence interval for the observed prevalence
prev_obs_upper
Upper limit of the confidence interval for the observed prevalence
Examples
data(chagas2012)
serodata <- prepare_serodata(chagas2012)