Calculating zscore for children nutritional status

Hi..

can anyone help me with syntax in ODK.. how to calculate z score for children nutritional status like one they use in WHO anthro??

Thank you so much

Hi, I haven't done this in ODK, but did do it in R for a recent
project...would think you'd be best to export to a .csv and use another
program...in R or even Excel it's pretty fast to calculate the table-wise
scores, bin them by age/gender and then merge with the z-score tables that
WHO provides. The formulas aren't so bad, just dividing your measurements
to come up with 'scores' and placing them in reference to WHO's tables.
Cool way to do it might be to build them into the form, (height for age,
weight for age, height for weight) making sure you're separating by gender
and age group and heights/weights are collected in the right format, then
putting in calculate functions such as ${height in cm} div ${age in
months}. Then you could have scores for your whole population ready to
export once they get to Aggregate.

You could also get fancier and try to make the form do the whole job,
putting in a restriction that selects the right reference mean and SD from
WHO tables based on the collected age and gender of the child, then a
calculate for the z-score formula: (your score - reference mean) /
reference SD . This would probably be a pretty complicated nested logic
statement, like if ${age in months} <= 59 AND ${gender} = 'F', ((${my
height for age} - (WHO's under-5 height-for-age mean)) div (WHO's under-5
F height for age SD), else ${age in months} >=60 AND ${gender} = 'F',
.....and so on to cover all the options (I'm not sure of that syntax for
XLSform, btw). I'm pretty new to programming so I'd probably stick with
calculating the scores within the form and exporting to finish elsewhere.

Good luck!

··· On Wednesday, December 9, 2015 at 3:46:05 AM UTC+5:30, Yosel lina wrote: > > Hi.. > > can anyone help me with syntax in ODK.. how to calculate z score for > children nutritional status like one they use in WHO anthro?? > > Thank you so much

Hi Jordan

Could you share your Rcode you developed for this? Is it on github?

Thanks

Hi Shylock,

My code isn't on github, basically it's a tedious cleaning process of a
really disastrous dataset, but the part relevant to z-scores is as follows:

  1. Download whichever of WHO's standard tables you need, here:
    http://www.who.int/childgrowth/standards/en/
    http://www.who.int/childgrowth/standards/en/...we were looking at
    stunting so I focused on height-for-age
  2. Groom up your dataset to have height in cm, weight in kg, and age in
    months
  3. Load in the WHO data
  4. Use some kind of merge function to put the tables together (mine is
    below) so you match each of your kids to WHO's standards according to their
    age
  5. Write a little formula to calculate the z-score (distance from WHO's
    mean, basically) and throw it on the end of the table
  6. Plot, present, high five!

Here's the code, basically:

mydata<-child[,c('Id','agemonth','cm','kg')] ##child is my whole dataset
colnames(mydata)<-c('ID','Month','Height','Weight')
whodata<-read.csv(file.choose()) ##load in appropriate WHO table... create
big .csv of all the tables, maybe, as they're broken down on WHO by
age/gender/height/weight
ztable<-merge(mydata, whodata, by = 'Month')
ztable$z<-(male$Height-male$M)/male$SD ##Height is my respondent's height,
M is WHO's mean, SD is WHO's SD

Hope this helps!

Cheers,
Jordan

··· On Wednesday, December 9, 2015 at 10:04:18 AM UTC+5:30, Shylock Muyengwa wrote: > > Hi Jordan > > Could you share your Rcode you developed for this? Is it on github? > > Thanks > >

Hi Shylock,

This might be a terrible idea, but if the z-scores are a big lookup
table, you can probably use CSV preloading with the lookup key being
(height_weight_age).

https://opendatakit.org/help/form-design/data-preloading
http://xlsform.org/#pre-loading-csv-data

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 6:58 AM, Jordan Levinson jord.levinson@gmail.com wrote:

Hi Shylock,

My code isn't on github, basically it's a tedious cleaning process of a
really disastrous dataset, but the part relevant to z-scores is as follows:

  1. Download whichever of WHO's standard tables you need, here:
    http://www.who.int/childgrowth/standards/en/ ...we were looking at stunting
    so I focused on height-for-age
  2. Groom up your dataset to have height in cm, weight in kg, and age in
    months
  3. Load in the WHO data
  4. Use some kind of merge function to put the tables together (mine is
    below) so you match each of your kids to WHO's standards according to their
    age
  5. Write a little formula to calculate the z-score (distance from WHO's
    mean, basically) and throw it on the end of the table
  6. Plot, present, high five!

Here's the code, basically:

mydata<-child[,c('Id','agemonth','cm','kg')] ##child is my whole dataset
colnames(mydata)<-c('ID','Month','Height','Weight')
whodata<-read.csv(file.choose()) ##load in appropriate WHO table... create
big .csv of all the tables, maybe, as they're broken down on WHO by
age/gender/height/weight
ztable<-merge(mydata, whodata, by = 'Month')
ztable$z<-(male$Height-male$M)/male$SD ##Height is my respondent's height, M
is WHO's mean, SD is WHO's SD

Hope this helps!

Cheers,
Jordan

On Wednesday, December 9, 2015 at 10:04:18 AM UTC+5:30, Shylock Muyengwa wrote:

Hi Jordan

Could you share your Rcode you developed for this? Is it on github?

Thanks

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thanks Yaw

I will look at this option

Regards
Shylock

··· On Fri, Dec 11, 2015, 07:43 Yaw Anokwa wrote:

Hi Shylock,

This might be a terrible idea, but if the z-scores are a big lookup
table, you can probably use CSV preloading with the lookup key being
(height_weight_age).

https://opendatakit.org/help/form-design/data-preloading
http://xlsform.org/#pre-loading-csv-data

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 6:58 AM, Jordan Levinson jord.levinson@gmail.com wrote:

Hi Shylock,

My code isn't on github, basically it's a tedious cleaning process of a
really disastrous dataset, but the part relevant to z-scores is as
follows:

  1. Download whichever of WHO's standard tables you need, here:
    http://www.who.int/childgrowth/standards/en/ ...we were looking at
    stunting
    so I focused on height-for-age
  2. Groom up your dataset to have height in cm, weight in kg, and age in
    months
  3. Load in the WHO data
  4. Use some kind of merge function to put the tables together (mine is
    below) so you match each of your kids to WHO's standards according to
    their
    age
  5. Write a little formula to calculate the z-score (distance from WHO's
    mean, basically) and throw it on the end of the table
  6. Plot, present, high five!

Here's the code, basically:

mydata<-child[,c('Id','agemonth','cm','kg')] ##child is my whole dataset
colnames(mydata)<-c('ID','Month','Height','Weight')
whodata<-read.csv(file.choose()) ##load in appropriate WHO table...
create
big .csv of all the tables, maybe, as they're broken down on WHO by
age/gender/height/weight
ztable<-merge(mydata, whodata, by = 'Month')
ztable$z<-(male$Height-male$M)/male$SD ##Height is my respondent's
height, M
is WHO's mean, SD is WHO's SD

Hope this helps!

Cheers,
Jordan

On Wednesday, December 9, 2015 at 10:04:18 AM UTC+5:30, Shylock Muyengwa wrote:

Hi Jordan

Could you share your Rcode you developed for this? Is it on github?

Thanks

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/UWEL8AFIzB8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shylock,

Did you manage to get the CSV pre-loading to work for the anthro survey? If
so, can you share your example?

Its something I have been thinking about since I become aware of the
pre-loading, and have never managed to find time to do.

~lb

··· On Friday, December 11, 2015 at 12:53:29 AM UTC-5, Shylock Muyengwa wrote: > > Thanks Yaw > > I will look at this option > > Regards > Shylock > > On Fri, Dec 11, 2015, 07:43 Yaw Anokwa <yan...@nafundi.com > wrote: > >> Hi Shylock, >> >> This might be a terrible idea, but if the z-scores are a big lookup >> table, you can probably use CSV preloading with the lookup key being >> (height_weight_age). >> >> https://opendatakit.org/help/form-design/data-preloading >> http://xlsform.org/#pre-loading-csv-data >> >> Yaw >> -- >> Need ODK consultants? Nafundi provides form design, server setup, >> in-field training, and software development for ODK. Go to >> https://nafundi.com to get started. >> >> On Wed, Dec 9, 2015 at 6:58 AM, Jordan Levinson <jord.l...@gmail.com > wrote: >> > Hi Shylock, >> > >> > My code isn't on github, basically it's a tedious cleaning process of a >> > really disastrous dataset, but the part relevant to z-scores is as >> follows: >> > >> > 1) Download whichever of WHO's standard tables you need, here: >> > http://www.who.int/childgrowth/standards/en/ ...we were looking at >> stunting >> > so I focused on height-for-age >> > 2) Groom up your dataset to have height in cm, weight in kg, and age in >> > months >> > 3) Load in the WHO data >> > 4) Use some kind of merge function to put the tables together (mine is >> > below) so you match each of your kids to WHO's standards according to >> their >> > age >> > 5) Write a little formula to calculate the z-score (distance from WHO's >> > mean, basically) and throw it on the end of the table >> > 6) Plot, present, high five! >> > >> > Here's the code, basically: >> > >> > mydata<-child[,c('Id','agemonth','cm','kg')] ##child is my whole dataset >> > colnames(mydata)<-c('ID','Month','Height','Weight') >> > whodata<-read.csv(file.choose()) ##load in appropriate WHO table... >> create >> > big .csv of all the tables, maybe, as they're broken down on WHO by >> > age/gender/height/weight >> > ztable<-merge(mydata, whodata, by = 'Month') >> > ztable$z<-(male$Height-male$M)/male$SD ##Height is my respondent's >> height, M >> > is WHO's mean, SD is WHO's SD >> > >> > Hope this helps! >> > >> > Cheers, >> > Jordan >> > >> > On Wednesday, December 9, 2015 at 10:04:18 AM UTC+5:30, Shylock Muyengwa wrote: >> >> >> >> Hi Jordan >> >> >> >> Could you share your Rcode you developed for this? Is it on github? >> >> >> >> Thanks >> > >> > -- >> > -- >> > Post: opend...@googlegroups.com >> > Unsubscribe: opendatakit...@googlegroups.com >> > Options: http://groups.google.com/group/opendatakit?hl=en >> > >> > --- >> > You received this message because you are subscribed to the Google >> Groups >> > "ODK Community" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to opendatakit...@googlegroups.com . >> > For more options, visit https://groups.google.com/d/optout. >> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "ODK Community" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/opendatakit/UWEL8AFIzB8/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> opendatakit...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> >

Dear Lloyd

I hadn't worked on it was on break. I will start doing do this coming week
and I will share my solutions.

Regards
Shylock

··· On Fri, Jan 8, 2016, 16:35 Lloyd Owen Banwart wrote:

Shylock,

Did you manage to get the CSV pre-loading to work for the anthro survey?
If so, can you share your example?

Its something I have been thinking about since I become aware of the
pre-loading, and have never managed to find time to do.

~lb

On Friday, December 11, 2015 at 12:53:29 AM UTC-5, Shylock Muyengwa wrote:

Thanks Yaw

I will look at this option

Regards
Shylock

On Fri, Dec 11, 2015, 07:43 Yaw Anokwa yan...@nafundi.com wrote:

Hi Shylock,

This might be a terrible idea, but if the z-scores are a big lookup
table, you can probably use CSV preloading with the lookup key being
(height_weight_age).

https://opendatakit.org/help/form-design/data-preloading
http://xlsform.org/#pre-loading-csv-data

Yaw

Need ODK consultants? Nafundi provides form design, server setup,
in-field training, and software development for ODK. Go to
https://nafundi.com to get started.

On Wed, Dec 9, 2015 at 6:58 AM, Jordan Levinson jord.l...@gmail.com wrote:

Hi Shylock,

My code isn't on github, basically it's a tedious cleaning process of a
really disastrous dataset, but the part relevant to z-scores is as
follows:

  1. Download whichever of WHO's standard tables you need, here:
    http://www.who.int/childgrowth/standards/en/ ...we were looking at
    stunting
    so I focused on height-for-age
  2. Groom up your dataset to have height in cm, weight in kg, and age in
    months
  3. Load in the WHO data
  4. Use some kind of merge function to put the tables together (mine is
    below) so you match each of your kids to WHO's standards according to
    their
    age
  5. Write a little formula to calculate the z-score (distance from WHO's
    mean, basically) and throw it on the end of the table
  6. Plot, present, high five!

Here's the code, basically:

mydata<-child[,c('Id','agemonth','cm','kg')] ##child is my whole
dataset
colnames(mydata)<-c('ID','Month','Height','Weight')
whodata<-read.csv(file.choose()) ##load in appropriate WHO table...
create
big .csv of all the tables, maybe, as they're broken down on WHO by
age/gender/height/weight
ztable<-merge(mydata, whodata, by = 'Month')
ztable$z<-(male$Height-male$M)/male$SD ##Height is my respondent's
height, M
is WHO's mean, SD is WHO's SD

Hope this helps!

Cheers,
Jordan

On Wednesday, December 9, 2015 at 10:04:18 AM UTC+5:30, Shylock Muyengwa wrote:

Hi Jordan

Could you share your Rcode you developed for this? Is it on github?

Thanks

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google
Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send
an

email to opendatakit...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/UWEL8AFIzB8/unsubscribe.

To unsubscribe from this group and all its topics, send an email to

opendatakit...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/UWEL8AFIzB8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

See the attached, abridged, XLS and CSV for one possible solution using pre-loading.

Our interest was to check if a child's weight was under -2SD of weight-for-height data while collecting data and if so refer the child.

From the (?) WHO tables we took the data for -2SD for girls and boys <= and > 2 years of age. This data is what you have in the .csv

We convert the child's age to months and then identify which column of the lookup file we need to search on (boys lte 2yrs, boys gt 2 years, girls lte yrs and girls gt 2years)

Then we use the pulldata to get the data we need, compare it against the collected weight and indicate if the child's weight is below the -2SD value.

Clemens

zScore.xlsx (14 KB)

zScore.xml (3.05 KB)

w4hzscore.csv (2.81 KB)

Clemens, thank you for sharing this!

~Lloyd

··· On Monday, January 11, 2016 at 11:50:38 AM UTC-5, cpma...@gmail.com wrote: > > See the attached, abridged, XLS and CSV for one possible solution using > pre-loading. > > Our interest was to check if a child's weight was under -2SD of > weight-for-height data while collecting data and if so refer the child. > > From the (?) WHO tables we took the data for -2SD for girls and boys <= > and > 2 years of age. This data is what you have in the .csv > > We convert the child's age to months and then identify which column of the > lookup file we need to search on (boys lte 2yrs, boys gt 2 years, girls lte > yrs and girls gt 2years) > > Then we use the pulldata to get the data we need, compare it against the > collected weight and indicate if the child's weight is below the -2SD > value. > > Clemens