Skip to contents

This function adds the necessary additional variables to the given dataset serodata corresponding to a serological survey.

Usage

prepare_serodata(serodata = serodata, alpha = 0.05)

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 and age_max, the dataset could already include the age group marker age_mean_f, representing the middle point between age_min and age_max. If afe_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 and age_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)