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.
This R package is very neat and useful.
Thank you Mark and Ernest.
Answered:
5 years agoThanks 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.
Answered:
5 years agoExcuse 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
Answered:
5 years agoThanks Ernest and Mark. I agree that this fills a gap. I will be sharing with my students.
Answered:
5 years agoThank you Mark & Ernest
Answered:
5 years agoHello,
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
Answered:
5 years agoDear Anonymous 27728 / Étudiant / Tidiani Cisse,
I am not sure that I understand your question. I guess that you have a SAM case with WHZ < -3 and you want to work out what weight for the same height would give WHZ >= 2 and this becomes a "target weight". Is that correct?
If so then it should be quite easy to write an short R script which uses the functions and reference data in the zscorer package to do the calculations You could wrap that script up with Shiny so you could do the calculations in your web-browser.
The mechanics of the R script will be something like this:
## Load zscorer library
library(zscorer)
## Sex, weight, and height for a SAM case
sex = 1
height = 91
weight = 9.9
## Calculate WHZ for this case
getWGSR(sex = sex, firstPart = weight, secondPart = height, index = "wfh")
This gives:
[1] -3.633671
This is the WHZ for the specified case (i.e. sex = 1 (for male), height = 91, and weight = 9.9).
We now need to calculate what weight for the current height gives WHZ = 2
## Specify the objective function
objFun <- function(weight)
{
result <- getWGSR(sex = sex, firstPart = weight,
secondPart = height, index = "wfh") + 1.99
return(result)
}
## Find the weight that gives an answer closest to zero
uniroot(objFun, interval = c(weight, 25))$root
This gives:
[1] 11.23279
This is the target weight
We can check the result with the original height and the target weight:
getWGSR(sex = 1, firstPart = 11.23279, secondPart = 91, index = "wfh")
This gives:
[1] -1.990001
which, as we wanted it just above WHZ = -2.
This process assumes that no height is gained during treatment. This may not always be the case as children tend to grow quickly when their nutritional needs are met.
A simple alternative ... UNICEF guidelines have a 15% weight gain as a target. For the example child this would be:
9.9 * 1.15 = 11.385
We can check what that gives:
getWGSR(sex = 1, firstPart = 11.385, secondPart = 91, index = "wfh")
This gives:
[1] -1.813269
which is also a bit above WHZ < -2 giving some room for a little gain in height.
The 15% proportional weight gain apporach is simple to apply with a table or using a cheap and simple pocket calculator.
BTW ... The GMP target weight tables are for normal growth in weight and we expect / want accelerated growth in therapeutic feeding.
I hope this is useful.
Answered:
5 years agoThanks Mark & Ernest. Quite informative and helpful.
Answered:
4 years agoHello 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
Answered:
4 years agoYes. Using addWGSR() to add z-scores to an R data.frame you can specify the number of digits you want using the digits parameter. For example, with surevy data in the svy data.frame object you might add WHZ with four digits using:
svy <- addWGSR(data = svy, sex = "sex", firstPart = "weight",
secondPart = "height", index = "wfh", digits = 4)
this should add WHZ as wfhz with four decimal places ... I am not sure why you would need this level of precision. If you need a different name than use the name parameter.
I hope this is of some use.
Thanks you for your kind comments about the software,
Answered:
4 years agoThanks a lot Mark!
Answered:
4 years agoHello,
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.
Answered:
4 years agoI am not sure I fully understand the question. WHZ for a boy with height = 73.5cm and weight = 7.2 kg is -3. This is from the WHO table:
www.who.int/childgrowth/standards/WFL_boys_0_2_zscores.pdf?ua=1
Using zscorer:
>getWGSR(sex = 1, firstPart = 7.2, secondPart = 73.5, index = "wfh")
gives:
[1] -3.078397
which is close enough (it is -3 exactly if weight is about 7.245 but we almost never mesure weight with that degree of precision).
WHZ does not include an age term. It is considered a strength of W/H that age is not used (since it is often not accurate). We do account for age indirectly by using length rather than height in children aged less than two years or with height less than 87 cm (a proxy for two years of age). This may be the origin of the discrepancy you report.
If I specify standing = 1 (i.e. measured standing) as in:
>getWGSR(sex = 1, firstPart = 7.2, secondPart = 73.5, index = "wfh", standing = 1)
which gives:
[1] -3.26919
I think this is your "-3.27".
If you use zscorer and do not specify a 'standing' value then height (and age) rules apply. You can see these rules if you type '(getWSGR)' to print the function defintion.
The "0.7" is a correction that accounts for compression of the spine when standing. You can do this before using getWGSR() or addWGRS() to match the DRC table or use the 'standing' parameter.
You could rewrite the getWGSR() function to make it match results given in the DRC table. That would not be hard to do.
I hope this helps.
Answered:
4 years agoThank 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
Answered:
4 years agoThe WHO table for younger(i.e. < 2 years) children is usually for weight-for-length (i.e. children measured lying down). There are weight-for-height tables for children of all ages (capable of standing upright). When you measure a child lying down the length is greater than the height. Before the WGS we used to assume the difference was 0.5 cm and adjusted the length by -0.5 cm to estimate height in order to work with weight-for-height tables. Since WGS we have used 0.7 cm. This is the difference in reference median height for two year olds in L/A (M = 87.8 cm; F = 86.4 cm) and H/A tables (M = 87.1 cm; F = 85.7 cm).
I do not know how the DRC tables were made. I doubt they used a separate reference population from locally collected data. I guess they just joined the W/L table (kids < 2 years) an the W/H table (kids >= 2 years) together was done with the old NCHS reference. You could ask your local nutrition cluster for guidance. SMART project people might know. Someone on EN-NET might know.
You need to take care of the sign of the adjustment. If the child was measured lying down then subtract 0.7 cm to use the W/H table to get WHZ and do nothing to use the W/L table to get WLZ. If the child was measured upright then add 0.7 cm to use the W/L table to get WLZ and do nothing to use the W/H table to get WHZ. Does that make sense? This sort of behaviour is encoded in the height / age rules in the gettWGSR() function in zscorer.
I hope this helps.
Answered:
4 years agoagain, 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.
Answered:
4 years agoThe WHO / UNICEF handbook:
RECOMMENDATIONS FOR DATA COLLECTION, ANALYSIS AND REPORTING ON
ANTHROPOMETRIC INDICATORS IN CHILDREN UNDER 5 YEARS OLD
which is available from here has:
Always record carefully whether recumbent length or standing height was measured. If a child is 2 years old or older and cannot stand, measure the child’s recumbent length and note this in the questionnaire (in the question about measurement position); equally, if a child is less than 2 years old and is measured standing, this should also be noted in the questionnaire. In both cases, explain why this child was not measured in the appropriate position for his or her age. In such cases, an adjustment will be required in the data analysis phase prior to calculating the z-scores based on the WHO Child Growth Standards (0.7 cm should be added to the standing height to convert it to recumbent length for children below 2 years old old, and 0.7 cm subtracted from the recumbent length to convert it to standing height for children 2 years or older). This adjustment is made automatically by the software program in the standard analysis approach (see Chapter 3 on Data Analysis).
on page 41 (also see Table 9). This correction procedure is present in the WHO scripts for R and STATA and in the xscorer getWGSR() function.
I hope this helps.
Answered:
4 years agoHello 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
Answered:
4 years agoI assume you mean "length" not "waist" measurement.
I think you are saying that your example weights and heights should be giving a WHZ = -3 but actually give WHZ a litte below -3.
Looking at your first example (male, weight = 7.2, length = 73.5) using the WHO table at:
https://www.who.int/childgrowth/standards/WFL_boys_0_2_zscores.pdf?ua=1
shows 7.2 in the -3 SD column for height = 73.5. If we use the LMS values we get:
z = (((7.2/9.1927)^-0.3521) - 1)/(-0.3521 * 0.08276) = -3.082965
this should be adjusted. See page 203 of:
This is the procedure used in anthro, igrowup, zscorer, and other software as well as for the production of the WHO lookup tables.
After adjustment we get WHZ = -3.078397.
It seems to me that rounding error may have crept into the WHO and DRC tables. Playing with values (altering weight, keeping height the same, and recalculating WHZ) i get:
getWGSR (sex = 1, firstPart = 7.2455, secondPart = 73.5, index = "wfl", standing = "2")
[1] -3.000095
This 7.2455 kg gives very close to WHZ = -3 but we never measure to that degree of precision ... 100 g precision is about the best we can do with Salter type sprung hanging scales. If we round 7.2455 kg to 100 g precision we get 7.2 kg.
I have long opined in this forum that WHZ is overly complicated and prone to error. I think this is a large part of what we are seeing here. I think we can live with a small error that we cannot avoid and favours sensitivity. A difference is z-scores of c. 0.08 seems little to worry about. It seems a very thin line to have between treating and not treating very thin children.
Answered:
4 years agoI 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.
Answered:
4 years agoI am glad that I was able to help.
I am interested in "combined" protocols which treat SAM and MAM cases in CMAM type programs with MAM cases receiving a shorter and less intensive RUTF-based treatment protocol.These programs tend to use MUAC (PB) to decide admission and children with MUAC (PB) between 115 mm and 122 mm would be admitted.
Answered:
4 years agoHi There,
I have been using the package for my survey on school age children to which some of them have more than 120cm (give me a problem on weight-for -height. I also have a problem with Wight-for-age since some of my age are above 120 months.
Is there a way to go arround this? I know the package is restric to those ranges.
Thank you.
Answered:
3 years agoHi 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.
Answered:
3 years agoHi 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.
Answered:
3 years agoThe 'zscorer' package is limited by the ranges for which reference values are a available. For W/H the upper limit is 120 cm. For W/A the upper limit is 120 months.
The 'zscorer, package uses the WHO Child Growth Standards and the WHO Growth References for children and adolescents. If you have reference data for wider ranges then that can be added quite easily.
We have (e.g.) recently added MUAC/A z-scores as described in:
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
extending the upper limit to 228 months. This did not take very much work. The most work was in getting the reference data into a format compatible with that expected by internal functions of the 'zscorer' library. It is a simple format but there may be a lot of data to import.
It may be possible to use the CDC 2000 reference which has (e.g.) 240 month as the upper limit for W/A with data in close to the required format. You may want to use CDC software to use teh CDC reference.
We can probably help with adding reference datasets.
Answered:
3 years agoJust checked ... CDC 2000 is in EpiInfo 7 and a couple of SAS programs are also available.
Answered:
3 years agoThe 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.
Answered:
3 years agoApologies, in my last reply I mean to write 240 months, not 24 months.
Answered:
3 years agoHi 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
Answered:
3 years agoHi 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
Answered:
3 years agoHi 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!
Answered:
3 years agoYou 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.
Answered:
3 years agoHi Halfan and colleagues,
Happy New Year! I hope eveyrone is well.
I am writing to follow-up from my previous post in this thread asking for testing data from those who have data usable with the CDC growth standards (i.e., height and weight measurements for older kids).
We have not heard back from anyone yet so I am writing again to see whether there maybe anyone happy to share data for us to test the new functions on.
So far, we are able to check the new functions to calculate BMI-for-age, weight-for-age and height-for-age but for a dataset that only contains data up to children below 5 years.
If you have any leads on contacts you have that we may approach to request such data will be great.
In the meantime, we will keep these new functions in the development version of the zscorer package until we are able to do proper unit testing on the functions.
Again, you can follow the development of the package with regard to the inclusion of these new functions to calculate z-scores using the CDC growth standards here.
Best,
Ernest
Answered:
3 years agoThis New features and tools are welcome.
But i wonder if Health personnal fill well data in children clinical Card
I tried to use my child information in Shiny App but i failed.No data, somebody Somewhere In health facility forget to fill well.
Answered:
3 years agoHi Anonymous 40504,
May I know the values of the data that you are entering so I can replicate the error you are having to see if indeed there is an issue? The Shiny app is just a front-facing application for those who don't use R so they can calculate z-score using the functions in the package. So, if indeed we find there is a problem with the app, we can investigate the app itself (it might not be handling the inputs appropriately or using the functions correctly) or investigate the zscorer package itself to check the functions that are powering the app.
The other thing to be careful about when using the app and also when using the functions is that it requires the units of measurements that are used to be of a specific type. So for weight it should be in kgs, for height it should be in cms, for muac it should be cms. This is a common source of error in calculations when using the zscorer functions.
Finally, the corresponding outputs will be dependent on your inputs. For nutrition surveys, we often just measure height, weight and MUAC. We do not routinely measure triceps skinfold, subscapular skinfold and head circumference. So, if you just enter weight, height and MUAC, then the app will not provide results for head circumference for age, triceps skinfold for age and subscapular skinfold for age.
Let me know more about what child information you are entering and if possible the output you are getting so I can review and make sure whether there is something that needs checking.
Best,
Ernest
Answered:
3 years agoDon't forget that we need to have age in the correct format. This may need to be in days which can be calulated from age in months.
Answered:
3 years agoWow, this looks awesome. Do you have a way to import other growth curves (like the fenton curve for premature infants)? Thank you so much for building this
Answered:
2 years agoPearl,
Yes. The growth curves are stored in the data.frame "wgsData" which is part of the package. You can see what this looks like using:
require(zscorer)
head(wgsData)
This allows the sort of extension you describe ... we only need to add the reference to this data.frame. The process is quite simple if the growth curve data are in LMS format. We recently (2019) added an extended MUAC/A reference from:
Mramba, L., Ngari, M., Mwangome, M., Muchai, L., Bauni, E., Walker, A. S., et al. (2017). 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 (Clinical Research Ed.), j3423. http://doi.org/10.1136/bmj.j3423
and this was done in, I think, half a day. Most of the work was in hammering the data into the right format. It can, however, take a while from packages to be tested and accepted by CRAN (CRAN = Comprensive R Archive Network).
You may not need to bother with this as the 'peditools' package provides Fenton (2003) and other neonatal and paediatric growth references. This package is not yet available on CRAN but can be installed in R. See here for how to install.
The 'pedidools' library uses LMS format reference data so we know it is available. The LMS data can be found in in Fenton (2007).
I hope this is of some use.
Answered:
2 years agoHi Mark and Pear H,
Agree with what Mark has said. Adding any other growth curve would be straightforward for as long as we can have the LMS data which I think Mark was able to find. Also, he was able to refer you to an R package that seems to calculate anthropometrics based on the Fenton curve (the peditools package).
I looked at the peditools package and I would recommend testing it out first. The last update was fairly recent (August 2021) so it must be in current development. But I don't see any testing profile for the package etc so behaviour may not be guaranteed so would recommend playing with it and reaching out to the developers if you find issues. My guess from the developers page is that this is still in active development and is not fully packaged yet (hence not on CRAN). So, I would recommend using it with caution and communicate with the developer if with issues.
I briefly looked at the functions that it uses to get the z-scores base don the Fenton LMS data and the approach on the use of the LMS is what I would have expected so this is credible. The issues you may face is with installation and more of the software side fo things with regard to getting it into your R.
I hope this helps.
Answered:
2 years agoHi all,
Picking up on this thread. I am noting a discrepancy for a subset of cases when calculating z-scores with this package and STATA's zscore06 package. While several of these cases have edema, others do not. I am wondering to what extent the ues of age in days (R) and months (STATA) may contribute to this?
I calculate age in days by multiplying the age in months by (365.25/12).
Answered:
1 year agoAre you able to provide me a reproducible example of what you are saying with regard to the discrepancy so that I can reproduce the issue that you are saying?
Ideally, if you can share the dataset that you are using from which you are noting the discrepancy. You can restrict the variables to those that are needed to calculate the z-scores in R. Also, I don't have and I don't use STATA so if you can add the z-scores to the dataset that is produced by the STATA package that you are talking about that would be great.
I would like to reproduce the issues that you are mentioning myself and this will give me insight to answer your question.
If you can share with me the code you are using in R to calculate the z-scores that will be useful for later if I am not able to reproduce the issue that you are saying.
Answered:
1 year agoAre you able to provide me a reproducible example of what you are saying with regard to the discrepancy so that I can reproduce the issue that you are saying?
Ideally, if you can share the dataset that you are using from which you are noting the discrepancy. You can restrict the variables to those that are needed to calculate the z-scores in R. Also, I don't have and I don't use STATA so if you can add the z-scores to the dataset that is produced by the STATA package that you are talking about that would be great.
I would like to reproduce the issues that you are mentioning myself and this will give me insight to answer your question.
If you can share with me the code you are using in R to calculate the z-scores that will be useful for later if I am not able to reproduce the issue that you are saying.
Answered:
1 year agoDear Mark and Ernest, thanks for developing the zscorer package; it is a great help.
I would like to ask your help, as when I compare the results I get from Zscorer to the one from Anthro in R , there are some discrepancies. Specifically, with Zscorer, the number of children defined as SAM, according to their WHZ, is lower than the number I get in anthro.
The sample includes 200 children aged 6 to 60 months old.
The commands we used in R were:
- For Zscorer:
fullbaseline <- addWGSR(data=fullbaseline, sex= "sex_child", firstPart= "weight_average", secondPart= "height_average", index = "wfh", standing = "height_position", output = "WHZ")
age was counted in days according to the formula:
fullbaseline$age_days<-fullbaseline$child_age * (365.25 / 12)
With this command, we get :
table(fullbaseline$sam_mam)
MAM :107 ; SAM : 93
- For Anthro:
with (fullbaseline, anthro_zscores ( sex = sex_child, age = age_child_months, is_age_in_month = TRUE, weight = weight_average, lenhei = height_average, measure= height_position, armc = MUAC_average, triskin = triceps, subskin = subscapula ) )
With this command, we get :
table(fullbaseline$sam_mam)
MAM: 92 ; SAM : 107
With Anthro, we have one missing data as one child was 60 months and a few days at the enrolment.
Here, I report some examples of children defined SAM in Antrho and MAM in Zscorer
Age
Months
Age
Days
WEIGHT
HEIGHT
_Lenght
H.Position
Oedema
WHZ ZSCORER
WHZ
Anthro
33.4
1016.6125
8.9
83.6
1/L
0
-2.88
-3.07
32.8
998.3500
9.5
86.6
1/L
0
-2.88
-3.07
36.8
1120.1000
8.9
83.6
1/L
0
-2.88
-3.07
24.5
745.7188
7.5
74.5
1/L
0
-2.84
-3.03
32.2
980.0875
8.0
78.1
1/L
0
-2.92
-3.08
Thank you in advance for your assistance!
Kind regards,
Silvia
Answered:
1 year agoThe new version of the R package 'zscorer' (v0.3.1) available in the Assessment and Surveillance area includes the following updates:
- Calculation and addition of nutritional anthropometry z-scores to survey data for children under 5 years of age, using the WHO Growth References and the new MUAC-for-age reference data.
- Inclusion of a Shiny app that provides a web interface to the package's functions. This app can be used to calculate and visualize z-scores for individual children or groups of children.
- Validation of the package with African school-age children and adolescents.
The zscorer package can be downloaded and installed in R in the usual manner. The package website is here and a manual is included in the package and is available here.
Here are some of the benefits of using the new version of zscorer:
- It is based on the latest WHO Growth References and MUAC-for-age reference data, which ensures that the z-scores calculated are accurate and up-to-date.
- The Shiny app provides a convenient and user-friendly way to calculate and visualize z-scores, making it ideal for use in a variety of settings, such as research, surveillance, and clinical practice.
- The package has been validated with African school-age children and adolescents, making it more reliable for use in this population.
Overall, the new version of zscorer is a valuable tool for assessing and monitoring the nutritional status of children under 5 years of age.
Answered:
1 year agoSilvia,
Thanks for your question.
This is related/similar to the question raised by Grace Heymsfield earlier.
Please note that this issue is in our radars but unless we have/know full documentation of the anthro package code, it is difficult to reverse engineer the reasons for the discrepancy.
What I have learned based on Grace's earlier question is that the most likely reason for the discrepancy is related to the age metric. In our package, we use the WGS tables that use age of child in days hence we ask users to convert their data for age in months into days (if there is no available data to actually properly calculate the age of child in days - i.e., when the date of birth is available). From what I know and have read of the anthro package documentation, they use both the WGS table that uses months and the WGS table that uses days. This means that if your data uses age in months, then you need to specify in their anthro_zscores that the data for age is in months.
This is the most likely reason for the discrepancy and the data shared to me by Grace (to diagnose the issue she found) shows this.
What I also found out is that if you add SMART ENA into the picture to compare, you will also get some discrepancies between the results for z-scores for SMART ENA, for anthro package and for zscorer package.
This is the main reason that for our perspective this is not a critical issue to put the time on right now. We will eventually get to figuring out how to standardise this (the issue is not how really, it is the time to do it).
I think that if you are doing a research study that has good data on the actual birth dates of the kids, then I would recommend actually performing a direct calculation of their age in days. In this regard, there will be no discrepancy between the results of the anthro package and the zscorer package. In this case, either anthro package or zscorer package will fit your needs.
But if you are working on survey data where a good number of responses for age are not based on actual birth date, then for sure you will need to default to using age in months as your age value. For this, I would recommend using the anthro package instead. I say this more from a consistency point of view as you will be able to set the function to use age in months as the reference table. This is likely going to give you a more consistent zscore result.
In theory, the ideal approach will be to calculate the age of each child in days if the birth dates are available and then have another variable for age in months for those children who self-report their age in months. Then use the anthro package accordingly to calculate z-score for those with age in days using the days reference table and then caculate z-score for those with age in months using the months reference table (the function is vectorise so you can apply it per row of data based on the type of age reported).
Within the last quarter of this year, we intend to update/re-factor the zscorer function to allow for either age in months or age in days to be inputted and to use the appropriate WGS table for these calculations.
In the meantime, I have posted your issue to our developers hub - https://github.com/nutriverse/zscorer/issues/122 - where you can see our progress on this issue (and that of Grace).
Answered:
1 year agoDear Ernest,
Thanks for taking the time to provide such a detailed answer.
We actually have the birth dates of the kids involved in the study and have used them in Antrho with no different results.
I appreciate your recommendations and will continue to follow the discussion.
Thank you again for your assistance.
Best regards,
Silvia
Answered:
1 year ago