statist7 / LMSgrowth2

MIT License
2 stars 2 forks source link

Output centiles from growth reference for a given measurement #8

Open tamuri opened 5 years ago

tamuri commented 5 years ago
tamuri commented 5 years ago

Centiles form from LMSgrowth:

03_centiles

tamuri commented 4 years ago

Using sitar::LMS2z

## construct table of boys weight centiles by age for WHO standard
data(who06)
zs <- -4:4*2/3 # z-scores for centiles
ages <- 0:12/4 # 3-month ages
LMS2z(ages, as.matrix(zs), sex = 'm', measure = 'wt', ref = who06, toz = FALSE)
statist7 commented 4 years ago

Hi Asif,

I’m not sure of the question… Are you pointing out that this code already does #8 ?

Best wishes, Tim

tamuri commented 4 years ago

Sorry, Tim, it wasn't a question! I was sharing the code with @giordano who is currently implementing this feature.

giordano commented 4 years ago

Other things to implement in the centile tab (pull request #26):

Update: DT makes handling the rounding much easier, you can control how to round each column

tamuri commented 4 years ago

From Tim (https://github.com/UCL/LMSgrowth2/pull/43#issuecomment-602607350):

Some curves have duplicated ages, e.g. UK-WHO height and BMI at age 2 and 4 years, indicating that two distinct references meet at that age. Ideally they should plot both values at the duplicated age, so the line segment is vertical. But in practice just one of the two values is stored and plotted. Not sure how to handle this.

tamuri commented 4 years ago

From Tim (https://github.com/UCL/LMSgrowth2/pull/43#issuecomment-602607350):

The age range for each reference is displayed. However this is not necessarily the age range for the current measurement, so there are missing data at the start of he range. Would it make sense for the age range to apply to the currently selected measurement?