Skip to contents

This function generates random sample sizes for each age group based on the overall sample size and the distribution of individuals across age groups. It uses multinomial sampling to allocate the total sample size to each age group proportionally.

Usage

generate_random_sample_sizes(survey_df_long)

Arguments

survey_df_long

A dataframe with columns 'age', 'group' and 'overall_sample_size'.

Value

A dataframe with random sample sizes generated for each age based on the overall sample size.