Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function: derive_params_growth_height - for BY LENGTH/HEIGHT growth parameters #34

Closed
rossfarrugia opened this issue Apr 30, 2024 · 0 comments · Fixed by #45
Closed
Assignees

Comments

@rossfarrugia
Copy link
Collaborator

New function:

derive_params_growth_height(
  dataset, 
  sex, 
  age, 
  age_unit, 
  meta_criteria, 
  parameter, 
  measure,
  height_age,
  set_values_to_sds, 
  set_values_to_pctl)

Arguments:

  • dataset: input dataset
  • sex, age and age_unit would define the variables to use from input dataset: e.g. sex = SEX, age = AAGECUR, age_unit = AAGECURU (age and age_unit are only needed if height_age argument is not NULL)
  • meta_criteria: metadata as defined in step 4 of MS Teams doc
  • parameter: the input dataset PARAMCD for which we want growth derivations: e.g. parameter = exprs(BMI = VSTESTCD == "BMI"). Options: “WEIGHT”
  • measure: the input dataset variable for which we find the length/height at each time point
  • height_age: the age in days at which the measure switches from body length to height as per the study CRF guidelines. If only ever length or height is used then leave this NULL and just feed in only the corresponding by length or height metadata (instead of the combined version which has both)
  • set_values_to_sds: variables to be set for zscore (SDS) parameter: e.g. set_values_to_sds(PARAMCD = “WGTHSDS”, PARAM = “Weight-for-length/height z-score”). If left blank then parameter not derived in output dataset.
  • set_values_to_pctl: variables to be set for percentile parameter: e.g. set_values_to_pctl(PARAMCD = “WGTHPCTL”, PARAM = “Weight-for-length/height Percentile”). If left blank then parameter not derived in output dataset.

Checks:

  • dataset
    • The variable for sex is in input dataset
    • The variables for age and age_unit are in input dataset if height_age is not NULL – age then first needs to get converted to DAYS using
    • The PARAMCD in parameter is available in input dataset as well as the variable in measure
    • the unit associated with each parameter is as expected (weight in kg)
  • metadata
    • has variables for MEASURE, SEX, HEIGHT_LENGTH, L, M, S

Derivations:

image

Example function call:

advs_wgt_height <- advs %>% 
  derive_params_growth_height(
    sex = SEX, 
    age = AAGECUR, 
    age_unit = AAGECURU, 
    meta_criteria = mymetadata,
    parameter = WGHT,
    measure = HGTTMP,
    height_age = 730,
    set_values_to_sds(
      PARAMCD = “WGTHSDS”,
      PARAM = “Weight-for-length/height Z-Score”
    ),
    set_values_to_pctl(
      PARAMCD = “WGTHPCTL”,
      PARAM = “Weight-for-length/height Percentile”
    )
  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants