# New version of R package 'zscorer' available

This question was posted the Assessment and Surveillance forum area and has 31 replies.

### Mark Myatt

Consultant Epidemiologist

Frequent user

5 Nov 2019, 14:55

Ernest and I have been working on the zscorer package for the R Language for Data Analysis and Graphics. v0.3.1 of the zscorer package calculates and adds nutritional anthropometry z-scores to survey data:

- Weight-for-length (wfl) z-scores for children with lengths between 45 and 110 cm
- Weight-for-height (wfh) z-scores for children with heights between 65 and 120 cm
- Length-for-age (lfa) z-scores for children aged less than 24 months
- Height-for-age (hfa) z-scores for children aged between 24 and 228 months
- Weight-for-age (wfa) z-scores for children aged between zero and 120 months
- Body mass index-for-age (bfa) z-scores for children aged between zero and 228 months
- MUAC-for-age (mfa) z-scores for children aged between 3 and 228 months
- Triceps skinfold-for-age (tsa) z-scores for children aged between 3 and 60 months
- Sub-scapular skinfold-for-age (ssa) z-scores for children aged between 3 and 60 months
- Head circumference-for-age (hca) z-scores for children aged between zero and 60 months

The z-scores are calculated using the WHO Child Growth Standards for children aged between zero and 60 months or the WHO Growth References for school-aged children and adolescents.

**New in this version** is that MUAC-for-age (mfa) z-scores for children aged between 60 and 228 months are calculated using the new MUAC-for-age growth reference developed by Mramba et al. (2017) using data from the USA and Africa:

Mramba L, Ngari M, Mwangome M, Muchai L, Bauni E, Walker AS, et al. *A growth reference for mid upper arm circumference for age among school age children and adolescents, and validation for mortality: growth curve construction and longitudinal cohort study*. BMJ. 2017

This reference has been validated with African school-age children and adolescents.

The zscorer comes packaged with the WHO Growth References data and the new MUAC-for-age reference data.

The package contains a Shiny app that provides a web interface to the package's functions. You can see an example of this functionality here.

The package can be downloaded and installed in R in the usual manner. The package website is here.

A manual is inlcuded in the package and is available here.

### Carlos Grijalva-Eternod

UCL Institute for Global Health

Normal user

5 Nov 2019, 19:54

This R package is very neat and useful.

Thank you Mark and Ernest.

### Ernest Guevarra

Katilingban

Frequent user

5 Nov 2019, 20:15

Thanks for sharing this to the forum Mark!

Mark and I are pleased to be able to share this package along with the accompanying web interface with the forum and to everyone who does nutrition studies and surveys. We think this fills a gap that we noted from some of the questions/issues raised in this thread with regard to tools for z-score calculation.

For those who already use R Language for Data Analysis and Graphics, then installation and usage will be straightforward using the links that Mark shared documenting the functions in the zscorer package.

For those that don't use R or are still in the early stages of learning R, the web interface allows for anyone to perform the calculations using familiar and easy to learn point and click user interface.

This package and the web interface is in active development. Mark and I are happy to receive feedback/comments/issue or bug reports/feature requests either via this EN-NET forum or through our GitHub development portal found here. Mark and I also embrace open source development and as such our codebase is available for anyone to review and give feedback to or build on. This is available, again, through our GitHub development portal.

### Anonymous 27728

Étudiant

Normal user

5 Nov 2019, 22:13

Excuse me, for it's not an answer but rather a question: please tell me if you know a way to calculate the target weight and height of a child without using the WHO Zscore table.

I would like to know whether there is another method to find the target weight of a child without using the WHO z-score table, because after taking the anthopomteric measurements for a child with W/H -3 we use the WHO table to find the target weight. My question is to find out whether there is another method of calculating this?

Thank you for taking my question into consideration, Tidiani Cisse Student

### Sharon Cox

Assoc Professor

Normal user

6 Nov 2019, 01:32

Thanks Ernest and Mark. I agree that this fills a gap. I will be sharing with my students.

### Mbaye Diop

Cellule de lutte contre la malnutrition

Normal user

7 Nov 2019, 13:59

Hello,

There are expected target weights for 1 month periods as part of growth monitoring and promotion (GMP).

Try to get acquainted with these tables, but they are for children from 0-23 months.

Thank you

### Martin Njoroge

Epidemiologist

Normal user

13 Nov 2019, 08:57

Thanks Mark & Ernest. Quite informative and helpful.

### Severine Frison

Normal user

15 Apr 2020, 11:57

Hello Mark,

I've been using the package, really great work. Thanks a lot.

I have one question though, it seems like zscores are rounded to 2 digits only. Is there a way to change that option?

Many thanks in advance

Sev

### Cécile Cazes

ALIMA/INSERM

Normal user

22 May 2020, 23:24

Hello,

The weight-for-height calculation table used in the DRC corresponds to the WHO unisex boy table but does not take into account the child's age. So when I compare the classification of children according to the W / H ratio according to the DRC table and according to a variable calculated with the package zscorer or other package R such as anthro or igrowup, I observe differences in classifications.

For example, a 29 month old child with a weight of 7.2 kg and a height of 73.5 cm has a W / H ratio = -3 according to the DRC table but a W / H ratio = - 3.27 according to the WHO table for boys. So when I check the classification by the nurses of this child in two categories, SAM or Non-SAM, my calculated variable indicates a SAM classification while the child is non-SAM according to the DRC table, so there is no error according to the table used in the DRC. I found 1.5% of discrepancy of this type due to the fact that the calculation of the weight / height index according to the WHO 2006 standards is based on the age or the taking of the standing or lying height of the child.

The ideal would be that I can integrate the DRC weight / height table into an R program to avoid these discrepancies. What do you think? Do you think this is doable? How? Or maybe there are other alternatives?

Thank you in advance for your help.

### Cécile Cazes

ALIMA/INSERM

Normal user

25 May 2020, 11:33

Thank you very much for your answer.

I would like to understand how the DRC table is designed.

According to my research, this is the WHO table for boys, but I noticed that the values correspond to either children under 24 months of age (lying down measurement) or children of + 24 months of age (standing measurement).

If I understand your answer correctly, you mean that the DRC table corresponds to the WHO boys table with a systematic correction made on the height: + 0.7 cm compared to the actual height? is it this?

so I should apply the argument: index = wfh height = height + 0.7 cm systematically to get the values from the DRC table?

Thanks for your help

### Cécile Cazes

ALIMA/INSERM

Normal user

25 May 2020, 14:34

again, Thank you for your suggestions, I will apply your instructions.

One last question, do you have a bibliographic reference regarding the 0.7 cm correction?

Thank you again.

### Cécile Cazes

ALIMA/INSERM

Normal user

26 May 2020, 11:50

Hello again,

After checking, I still have the same problem of discordant values between the WHO table for the WFL boy table (0-2years old, 45 to 110 cm) and the WFL value calculated by the package.

All of the children below are under 24 months of age with a length measurement while lying down. The WHO boy WFL table indicates a wfl z-score strictly equal to -3; these children are classified as not severe.

On the other hand, the variable calculated with zscorer indicates a wfl z-score <-3; these children are in the severe class. I found the same result using the R anthro and igrowup packages.

With zscorer:

getWGSR (sex = 1, firstPart = 7.2, secondPart = 73.5, index = "wfl", standing = "2")

[1] -3.078397

getWGSR (sex = 1, firstPart = 6.8, secondPart = 71.1, index = "wfl", standing = "2")

[1] -3.073756

getWGSR (sex = 1, firstPart = 5.7, secondPart = 65.0, index = "wfl", standing = "2")

[1] -3.078341

getWGSR (sex = 1, firstPart = 5.3, secondPart = 63.2, index = "wfl", standing = "2")

[1] -3.199316

getWGSR (sex = 1, firstPart = 5.4, secondPart = 63.5, index = "wfl", standing = "2")

[1] -3.10421

### Cécile Cazes

ALIMA/INSERM

Normal user

26 May 2020, 14:42

I apologize for the confusion on the term "size" which comes from the translation from French / English I think (only one word in French).

Your explanations are of great help, thank you very much.

I had this assumption on rounding of size or weight but I would not have been able to confirm them as you did. thank you so much.

some children are classified in the -3 SD column when they are severe and miss out on treatment with RUTF it is a shame. In the specific case of these 5 children, the MUAC was between 115 and 122, therefore children at high risk of mortality who escape treatment with RUTF according to the national protocol.

Thanks for your help.

### Halfan Ngowo

Normal user

4 Dec 2020, 11:19

Hi There,

I have been using the package for my survey on school age children in which some of them are more than 120cm (give me a problem on **weight-for -height**. I also have a problem with **Weight-for-age** since some of my ages are above 120 months.

Is there a way to go around this? I know the package is restricted to those ranges.

Thank you.

### Carlos Grijalva-Eternod

UCL Institute for Global Health

Normal user

4 Dec 2020, 12:10

Hi Halfan,

For children older than 10 years (120 months) or taller than 120 cm you should be using BMI-for-age z-scores rather than Weight-for-height or Weight-for-age.

This is a limitation of the actual WHO growth references, not of the 'zscorer' R package.

I hope the above is useful.

### Carlos Grijalva-Eternod

UCL Institute for Global Health

Normal user

4 Dec 2020, 14:23

The 2000 CDC Growth Charts are also available in Stata by using the *zanthro *Stata command. *zanthro *is not part of Stata so you will need to install it.

As Mark mentioned, the CDC chart will allow you to derive z-scores for weight-for-age up to the age of 24 months, but for weight-for-height, the upper limit is 121.5 cm. Above that height limit you will need to rely on BMI-for-age to assess ponderal growth.

I hope the above is useful.

### Carlos Grijalva-Eternod

UCL Institute for Global Health

Normal user

4 Dec 2020, 14:25

Apologies, in my last reply I mean to write 240 months, not 24 months.

### Ernest Guevarra

Katilingban

Frequent user

11 Dec 2020, 13:07

Hi Halfan,

Mark alerted me to your discussion with him regarding assessing weight-for-height for those taller than 120cm using the CDC 2000 reference.

What Mark has shared with regard to the possibility of updating the package to use the same function (and its syntax) to get to this is definitely doable. I've filed this as an issue on our development site (check our development site here and the filing of the issue here.

I will start work on this update tonight and do unit testing by the weekend and will ask Mark to review next week. We will aim to submit to CRAN an updated version (most likely we will release this as a minor release v0.4.0 as this is a new feature rather than just a patch release) by next week before they take their winter break. If we don't make the cut, we'll do a GitHub development release instead as a stop gap measure before we release on CRAN next year. You can monitor progress in our development site and I will also give an update here on en-net by end of next week (if not earlier).

And to further add to the discussion which you and others who have related issue/question as yours, when we put zscorer on CRAN, we've been able to engage with other package creators who've done packages that calculated z-scores using so many other available reference standards. What I've learned is that the CDC reference standard doesn't have a package that uses it directly (not a package that is available on CRAN anyway) and I was helping out a group of researchers from the US who were trying to develop one. For some reason the development has stalled and the package hasn't really been moved long yet. I say this because if there was an already existing package that deals with the functionality that we are talking about, the common practice is to refer others to use that package rather than rebuild the wheel.

In another post here, I will share all published packages on CRAN that assesses anthropometric z-scores based on different reference standards.

Sorry again for delay in replying to this. This has been 7 days since you made raised this question. We will get on it now.

Best,

Ernest

### Ernest Guevarra

Katilingban

Frequent user

14 Dec 2020, 22:44

Hi Halfan,

Following up on my previous reply. We are working on the additional features to the zscorer package that has been suggested based on your question. I think we will not make it to the Friday deadline to get a version out before the CRAN team goes for winter break so we will now aim for a development release and then get a CRAN release out by early next year.

Also, I mentioned in my previous email that I will share some information on R packages that already calculate z-scores based on CDC 2000 reference values. From my engagement with those developing similar packages in R, there are two packages that have been suggested/recommended specific to CDC 2000 reference standards:

1. AGD package - available on CRAN (https://cloud.r-project.org/web/packages/AGD/index.html) and source code is available at GitHub. The package approach to calculating z-scores is somewhat similar to zscorer but the structure of the main functions are not as intuitive and documentation is a bit confusing. The package includes the CDC growth charts data (among others) which are used to apply the LMS calculation. I haven't personally used the package and from my reading of the documentation, I am hesitant to do so.

2. mchtoolbox package - not available on CRAN and development source code available at GitHub. As you will see in the GitHub repository page, the last commit by the lead developer or any of the development team was 3 years ago. So, the development stalled though they have their main function available and seems that they have been able to make it work. The approach to the calculation is based on the SAS script available for calculation z-scores using CDC growth standards and applies what is called as the "tidy" appraoch to data handling. This approach will provide the same answers as what the zscorer aproach uses but the structuring of output data is different.

Whilst we are completing the addition of the CDC growth standards into zscorer, you may want to look into these two packages to get immediate solution to your needs.

The alternatives will be to use EpiInfo or the SAS macros as suggested by Mark.

I will update again on Friday with regard to the addition of the CDC growth standards to the zscorer package.

Best,

Ernest

### Ernest Guevarra

Katilingban

Frequent user

21 Dec 2020, 10:51

Hi Halfa, Hi everyone else following this thread!

Mark and I have been working on adding the CDC 2000 Growth Standards to the *zscorer* package. Apologies for delays. I am not as familiar with the CDC standards compared to the WGS so have been reading full documentation to get the functions right.

Our current approach to this will be to use a similar syntax to the functions for getting z-scores using WGS. This will help with ease of use especially for those already familiar with using the WGS functions. We are now currently doing unit testing of the new CDC functions we have created.

A working/development version of this update can be installed in R using the following commands:

`if(!require(remotes) install.packages("remotes")`

`remotes::install_github("nutriverse/zscorer")`

The new functions for CDC calculation are:

`getCDC()`

`addCDC()`

with the same syntex as the WGS functions.

This is where we would like to enlist the support of those following this thread and the general en-net forum/community.

We will need data that will be usable for applying CDC standards to and ideally have information on the calculated z-scores using the already existing tools (i.e., EpiInfo, SAS). This can serve as a benchmark or gold standard and then we can check the output of the functions we've created against this benchark. It would be ideal that we have what we call **edge cases** within the dataset. This would include cases at the low extreme (0 months old), cases with ages at 24 month and 36 month which is where the weight-for-age standards for CDC diverge and those with height/length measurements at 45 cms, 77 cms, 102 cms and 122 cms which are at the borders of height/length measurements between supine and standing measurements.

We are happy to include anyone who helps with data as contributor/s to the package.

Thanks!

### Dr. James Oloyede

Nutrition Coordinator

Normal user

21 Dec 2020, 11:25

You guys at en-net are fantastic and of great help. I have followed the discussion all through and it is of immense benefit for me as I propose to add MAM management to our nutrition interventions in the Northeast among the IDPs in the coming years.

If you have any problem posting a response, please contact the moderator at post@en-net.org.