WHO Macro Files, CPEG Revision

WHO macros

For calculating Z scores in batch files, the WHO currently provides several macro packages for R, SAS, SPSS, and Stata; all are available from their website.

The application tools come in two flavours:

Due to limitations in the original WHO charts, the who2007 macros calculate weight-for-age Z scores for ages 5–10 years only while reporting BMI- and height-for-age from 5–19 years.

We have therefore replaced the weight-for-age LMS lookup table (wfawho2007) with a revised tabled augmented with LMS parameters for ages 10–19 years from our re-analysis of WHO data (BMC Pediatrics 2014;14:32). This also required revisions to the accompanying macro files (who2007). Currently, we are providing versions for R, Stata, and SAS. In all cases, changes to the original file can be identified by searching for comments containing the word ‘CPEG’. The original files are also included for comparison.

  • ZIP file containing the igrowup macro files, CPEG revision (for R)
  • ZIP file containing the who2007 macro files, CPEG revision (for R, Stata and SAS)

It should be noted that most LMS parameters are tabulated at monthly intervals. In our own applications, we round age to the nearest month before looking up the matching LMS parameters. In contrast, the WHO uses linear interpolation to estimate the ‘exact’ LMS parameters before calculating Z scores. In general, the difference is manifest as a slight ‘wobble’ in the second decimal place in the Z score. Use at your own risk.

We have also developed a combined macro quickZ which combines the data from igrowup and who2007, for calculating Z-scores for height, weight and BMI for children from 0–19 years of age using a single application.

  • ZIP file containing the quickZ macro files (for R)

R for various computing platforms is available free of charge from the Comprehensive R Archive Network (CRAN).

Blood pressure macro

We have also provided an R macro package to calculate pediatric blood pressure Z-scores for ages 2–18 years. Calculations are based on Appendix B in the NIH/NHLBI manual The Diagnosis, Evaluation, and Treatment of High Blood Pressure in Children and Adolescents, 4th edition. A copy of the manual is included as hpd_ped.pdf in the macro folder.

  • ZIP file containing the pediatric blood pressure macro files for R

Please note, the required height Z-scores are first calculated using LMS tables from the CDC 2000 growth charts; these values are then used to calculate age-, height-, and sex-specific SBPz and DBPz using the formulae in Appendix B. The results include the CDC height Z-scores used in the calculations.

Waist circumference macro

We have also provided an R macro package to calculate pediatric waist circumference and waist-height ratio Z-scores for ages 5–19 years. Calculations are based on our recently published norms [Pediatric Research 2015;78(6):723–729]. A copy of the relevant publication is included as PediatrRes_2015.pdf in the macro folder.

  • ZIP file containing the pediatric waist circumference macro files for R

Preterm macro

We have also provided an R macro package to calculate newborn Z-scores for gestational ages 22–49 weeks. Calculations are based on published norms [Fenton et al. BMC Pediatrics 2013;13:59].

  • ZIP file containing the preterm newborn macro files for R

Shiny apps

There is also an option for those wanting the CPEG macros, but uncomfortable with a statistical package. We have created an on-line application (Zapps™) running the CPEG macros on an R server (aka Shiny).

Batch data may be uploaded in the form of a comma separated variable (.csv) spreadsheet, from Excel or similar. An Excel calculator is also available for processing batch files (Windows only).

If you have questions, comments or suggestions, contact Dr. Atul Sharma or Dr. Dan Metzger.