Search code examples
rggplot2chartschild-processpercentile

Children Growth chart in R


I need to create a growth chart kind of graph for the following dataset:

df <- data.frame(height = c(150-154, 155-159, 160-164 ,165-169 ,170-174 ,175-179, 180-184 ,185-189, 160-164, 165-169, 170-174 ,175-179, 180-184 ,185-189 ,190-194, 195-199 ,>200),
                 weight = c(113 ,137 ,134 ,127, 143 ,110 ,159 ,155, 129, 136, 166, 165 ,182, 200 ,219 ,206 ,327), sex = c(women, women ,women ,women ,women ,women ,women ,women, men  , men   ,men   ,men  , men  , men ,  men  , men  , men),stringsAsFactors = F)

The kind of graph that I want to make is a similar one as the baby growth charts. With centile 5 and 95, and the median. As this one:

enter image description here

But for men and woman. I want height to be in the x-axis and weight in the y axis.

I was trying the package childsds, specially the code from Mandy Vogel: https://www.rdocumentation.org/packages/childsds/versions/0.7.4/topics/make_percentile_tab

But I cannot manage what I want cause I don´t know what a reference object is.

Could you help please? Sorry for the horrible piture but this is exactly what I want, the picture represents only one group, but I would want this for men and for women the percentiles are for weight as it is the median, at different heights:

enter image description here Thanks!


Solution

  • Caveat: I've not tested this, but since I see no replies to your question, I took a look at the package documentation, here: https://cran.r-project.org/web/packages/childsds/childsds.pdf

    and it looks like there are many "refgroup" objects in the package, which appear to be data sets of reference percentiles published by different authorities. For example, you might want this if you are in the USA: cdc.ref object with data about BMI etc. as documented on page 7