jsgrowup

0.8.0 • Public • Published

jsgrowup

Build Status

jsgrowup by Global Strategies is based on pygrowup by Evan Wheeler: https://github.com/ewheeler/pygrowup

jsgrowup calculates z-scores for the following anthropometric indicators:

  • weight-for-age

  • length/height-for-age

  • weight-for-length/height

  • head-circumference-for-age

  • body-mass-index-for-age

based on the WHO Child Growth Standards:

and can optionally use CDC growth standards:

jsgrowup avoids floating-point operations to eliminate the unwanted rounding that muddles the precision of some of the igrowup implementations:

INSTALLATION

npm install jsgrowup

EXAMPLE USAGE

demo.js includes a sample z-score lookup.

EXCEPTIONS

caller should watch for:

  • AssertionError raised when caller provides inappropriate parameters

as well as more specific errors (all subclasses of RuntimeError):

  • InvalidMeasurement raised when measurement is invalid for requested indicator

  • InvalidAge raised when age is invalid for requested indicator

  • DataNotFound raised when WHO/CDC data is not found for the requested observation (e.g., box-cox, median, coefficient of variance for age)

  • DataError raised when an error occurs while loading WHO/CDC data into memory

TESTING

  • test script using mocha: mocha --delay

  • no-framework tests: node simpletests.js

The included tests use example anthropometric data taken from demonstration data shipped with WHO's igrowup software. jsgrowup performs the same calculations and compares the results to the WHO results. Please see the sofware licence agreement for WHO's igrowup, which is the source of the test data files: http://www.who.int/childgrowth/software/license2.pdf

Currently, a small number of cases fail to produce results within 1 standard deviation of the WHO resuts. These discrepancies may be due to WHO's use of floating point arithmetic in their igrowup software, which leads to less precise calculations compared to jsgrowup. In the absence of any other trusted test data, please be aware that no claims are made to the accuracy or reliability of jsgrowup's calculations.

DEVELOPING

The source WHO .txt tables can be easily converted to json with the help of two amazing python utilities:

heres an example one-liner that changes the source .txt from tsv to csv (with pyp) and then to json (with csvkit's csvjson) $ cat bmi_girls_2_5_zscores.txt | pyp "p.replace('\t', ',')" | csvjson > bmifa_girls_2_5_zscores.json

Readme

Keywords

none

Package Sidebar

Install

npm i jsgrowup

Weekly Downloads

1

Version

0.8.0

License

BSD-3-Clause

Last publish

Collaborators

  • elon-gs