Skip to contents

Generates age intervals of length step in the interval spanned by age_min and age_max in a serosurvey. In cases where max(age_max)%%(step+1)!=0, the last age interval is truncated and will have a different length than the others.

Usage

get_age_intervals(serosurvey, step)

Arguments

serosurvey
survey_year

Year in which the survey took place (only needed to plot time models)

age_min

Floor value of the average between age_min and age_max

age_max

The size of the sample

n_sample

Number of samples for each age group

n_seropositive

Number of positive samples for each age group

step

step used to split the age interval

Value

Serosurvey with addition factor variable grouping age_intervals. The interval is taken as closed to the right and to the left.