Skip to main content

Calculate z-scores of anthropometric measurements based on the WHO Child Growth Standards

Project description

pygrowup calculates z-scores for the following anthropometric indicators:
weight-for-age, length/height-for-age, and weight-for-length/height
based on the WHO Child Growth Standards:
http://www.who.int/childgrowth/standards/en/
http://www.who.int/entity/childgrowth/standards/technical_report/en/index.html

pygrowup avoids floating-point operations to eliminate the unwanted rounding
that muddles the precision of some of the igrowup implementations:
http://docs.sun.com/source/806-3568/ncg_goldberg.html

REQUIREMENTS:
Python 2.5 or later
Additionally, Python 2.5 requires installation of simplejson library:
http://pypi.python.org/pypi/simplejson

INSTALLATION:
pip install pygrowup

EXAMPLE USAGE:
from pygrowup.pygrowup import *

# Height adjustments are part of the WHO specification (see section 5.1)
# to correct for recumbent vs standing measurements,
# but none of the existing software seems to implement this.
# default is false so values are closer to those produced
# by igrowup software
#
# WHO specs include adjustments (see Chapter 7) to z-scores of weight-based
# indicators that are greater than +/- 3 SDs. These adjustments
# correct for right skewness and avoid making assumptions about
# the distribution of data beyond the limits of the observed values.
#
# However, when calculating z-scores in a live data collection
# situation, z-scores greater than +/- 3 SDs are likely to indicate
# data entry or anthropometric measurement errors and should not
# be adjusted. Instead, these large z-scores should be used to
# identify poor data quality and/or entry errors.
# These z-score adjustments are appropriate only when there
# is confidence in data quality.
cg = childgrowth(adjust_height_data=False, adjust_weight_scores=False)

my_child = {'date_of_birth' : '100309', 'sex' : 'male',\
'weight' : '8.0', 'height' : '69.5'}

# use helper functions for formatting data

# transform '100309' into '2009-03-10'
valid_date = cg.helpers.get_good_date(my_child['date_of_birth'])

# transform 'male' into 'M'
valid_gender = cg.helpers.get_good_sex('male')

# calculate 9 months from '2009-03-10'
valid_age = cg.helpers.date_to_age_in_months(valid_date)


# call zscore_for_measurement(indicator, measurement,\
# age_in_months, gender, height)
# optional height parameter is only necessary for weight-for-height

# calculate length/height-for-age zscore
lhfa_zscore_for_my_child = cg.zscore_for_measurement('lhfa',\
mychild['height'], valid_age, valid_gender)

# calculate weight-for-age zscore
wfa_zscore_for_my_child = cg.zscore_for_measurement('wfa',\
mychild['weight'], valid_age, valid_gender)

# calculate weight-for-length zscore
wfl_zscore_for_my_child = cg.zscore_for_measurement('wfl',\
mychild['weight'], valid_age, valid_gender, mychild['height'])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygrowup-0.2.tar.gz (7.7 kB view details)

Uploaded Source

File details

Details for the file pygrowup-0.2.tar.gz.

File metadata

  • Download URL: pygrowup-0.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pygrowup-0.2.tar.gz
Algorithm Hash digest
SHA256 0ac20c78f4f27350c30af7fdbf3cdf73ff2cb4902e2d25b0e9090986411b805c
MD5 642f886640a6702bde4e7b3dd8cea4b0
BLAKE2b-256 f5330e506efeda18130b4e295e299396605b254cf7abe89c618b20652bead606

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page