create_participant_weight: Define participants weight from general population to compute...

View source: R/strata.R

create_participant_weightR Documentation

Define participants weight from general population to compute adjusted frequency

Description

Weights can be stratified and grouped : weights are computed by strata over each group For example : strata=age, gender and group= week, will allow to compute weekly frequency adjusted by age and gender

Usage

create_participant_weight(
  age.categories,
  year.pop,
  groups,
  strata,
  weekly,
  intake
)

Arguments

age.categories

age breaks vector (strictly increasing and unique values)

year.pop

year of the population to load

groups

list of weekly column to use as weight group

strata

list of intake columns to use as stratification to compute weight.. Must be one of pop (age.cat or gender)

weekly

weekly data

intake

intake data

Details

Strata can be either 'age.cat' or 'gender', since provided population are by age and gender. To have more strata will need to have general population data for each strata.

Value

data.frame() with columns (person_id, 'groups...', 'strata...', weight)


cturbelin/ifnBase documentation built on Nov. 5, 2023, 12:54 p.m.