Used to overcome the loss of variables (age, time since quit) in single years in the Health Surveys for England 2015+.

num_sim(x)

Arguments

x

Character - the age/time category e.g. "15-20".

Value

Returns an integer.

Details

Takes a category with beginning and end separated by "-" and randomly assigns each observation a number within the age category.

Examples


num_sim("15-20")
#> [1] 20