Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculating z-scores using zscore06 command

    Colleagues,

    Kindly assists on how to calculate WAZ, HAZ and WHZ scores using the "zscore06" command.

    I searched for the module and installed it by typing "ssc install zscore06".

    Having installed it, I now need to generate the zscores using the said command "zscore06"

    I searched for help using "help zscore06". Unfortunately, I seem not to get the syntax.

    What is the full syntax for calculating the z-scores? I am still figuring out how to proceed.

    Any example of how I can lay it out...?

    I am using Stata/SE13.1 for windows.

    Regards,
    Anderson

  • #2
    Dear All,

    I just cracked it myself.

    Best.

    Anderson.

    Comment


    • #3
      It's good that you managed to solve the problem yourself. However, I'd like to recommend that you say how you solved it, so that there is a record for all to see. This is called 'closing the thread' (and I think it's mentioned in the Statalist FAQ). thanks

      Comment


      • #4
        I took a look at the SSC package zscore06 and although it had a help file, I didn't find the lack of example code particularly helpful. I too am curious to see some expert example code. BTW, I learned that growth charts of children are not based on longitudinal data!

        Comment


        • #5
          Hi Anderson,
          Could you please provide one example for the z-score coding. I run into the same problem. Thanks for your help.

          Comment


          • #6
            Here is an example using the Sierra Leone DHS births dataset (Stata 13.1, Mac OS 10.9.4):

            Code:
            use "~/Data/model/SLBR51DT.zip Folder/SLBR51FL.DTA", clear
            //simple sample weighting using DHS for clusters only, no strata; must multiply by 1000000
            gen weight=v005/1000000
            svyset [pweight=weight], psu(v021)
            
            //hw15 is lying (1) and standing (2) height measure; clean DHS code
            gen newm=hw15 if hw15!=9
            //hw3 is height, clean DHS code and converts to cm
            gen newh=hw3/10 if hw3!=9999
            //hw3 is height in kg to one decimal w/o the decimal; convert to kg w/decimal; clean DHS code and
            gen neww=hw2/10 if hw2!=999
            //run zscore06. age in months (hw1) and gender (b4) need no cleaning in this dataset
            zscore06, a(hw1) s(b4) h(newh) w(neww) measure(newm) male(1) female(2)
            
            //remove biologically implausible scores
            replace haz06=. if haz06<-6 | haz06>6
            replace waz06=. if waz06<-6 | waz06>5
            replace whz06=. if whz06<-5 | whz06>5
            replace bmiz06=. if bmiz06<-5 | bmiz06>5
            
            //example using svy: mean of height-for-age
            svy: mean haz06
            Last edited by Richard Stanley; 11 Jul 2014, 13:38.

            Comment


            • #7
              am new in stata but i want calculate haz, waz and whz for kenyan children. i used the command zscore06, a(hc1) s( hc27) w( hc2) h(hc3) but the results are not similar with what is in the literature. can sby help me where am going wrong? thanks

              Comment


              • #8
                am new in stata but i want to calculate haz, waz and whz for kenyan children. i used the command zscore06, a(hc1) s( hc27) w( hc2) h(hc3) but the results are not similar with what is in the literature. can sby help me where am going wrong? thanks

                Comment


                • #9
                  Hi All,

                  There is another package that you can install in Stata to help you compute haz waz and whz. It has multiple ancillary files: WHO growth charts, CDC growth charts, and UK growth charts. The package is called
                  zanthro
                  you can install it by typing
                  Code:
                  findit zanthro
                  . Make sure you install the most recent version
                  SJ13-2 dm0004_1
                  The help command will provide you a few examples on how to use the package. In case you are interested the following forum provides an example on how to use the command with the CDC growth charts http://www.statalist.org/forums/foru...ro-malfunction Please note that the code excludes individuals outside 5 standard deviations. I attached some documentation on the package.

                  Patrick
                  Attached Files

                  Comment


                  • #10
                    Originally posted by Patrick Abi Nader View Post
                    Hi All,

                    There is another package that you can install in Stata to help you compute haz waz and whz. It has multiple ancillary files: WHO growth charts, CDC growth charts, and UK growth charts. The package is called you can install it by typing
                    Code:
                    findit zanthro
                    . Make sure you install the most recent version
                    The help command will provide you a few examples on how to use the package. In case you are interested the following forum provides an example on how to use the command with the CDC growth charts http://www.statalist.org/forums/foru...ro-malfunction Please note that the code excludes individuals outside 5 standard deviations. I attached some documentation on the package.[ATTACH]temp_1571_1423674648982_612[/ATTACH]

                    Patrick

                    Patrick, could you please share the zanthro code for generating haz score?

                    thanks beforehand

                    Comment


                    • #11
                      Thank you all very much!! I have learned a lot from your posts.
                      With Best Wishes,Hassen

                      Comment


                      • #12
                        Kamola Babamuradova
                        You should provide us with a sample of your data using dataex and more details on what you are asking for help with. For example, which growth charts are you wanting to use to compute the height for age z-scores? With the information you provide we have to be able to answer/ address all the components of the below code.

                        If you have read the help file of zanthro you will notice that you need to use a modified version of the below code:
                        Code:
                        egen [type] newvar = zanthro(varname,chart,version) [if] [in], xvar(varname) gender(varname) gencode(male=code, female=code) [ageunit(unit) gestage(varname) nocutoff]
                        Best wishes,
                        Patrick

                        Comment


                        • #13
                          Hi, I am relatively new to calculating Z-scores and can really use some advice on where to start.

                          I have downloaded the zscore06 command and not sure how to proceed from here. I am trying to calculate the WHZ and HAZ Z-scores, I have posted some of the dataset I am using below. I am not sure what the command should be?

                          dataex child_age Oedema weight length height

                          ----------------------- copy starting from the next line -----------------------
                          Code:
                          * Example generated by -dataex-. To install: ssc install dataex
                          clear
                          input byte(child_age Oedema) double weight float(length height)
                          31 2  9.8    .  71.5
                           8 2 18.3 66.8     .
                          39 2 12.8    .  96.1
                          20 2  9.6 79.4     .
                          32 2 15.5    . 107.3
                          40 2 14.2    .  93.9
                          48 2 13.6    .  99.7
                          29 2 10.9    .  85.2
                          54 2 16.8    . 105.6
                          37 .    .    .     .
                          57 2 17.1    . 106.9
                           7 2  7.4 64.5     .
                          44 2 15.2    .    94
                          25 2 11.4    .  81.3
                          42 .    .    .     .
                          48 .    .    .     .
                          47 2 15.5    .  97.6
                          36 2    .    .     .
                          23 2 11.9 87.9     .
                          11 2  7.2 67.2     .
                          34 2 12.7    .  86.1
                          10 2 12.9 86.9     .
                          14 2    .    .     .
                          42 .    .    .     .
                          32 2 16.6    .  97.3
                          28 2 10.3    .  82.6
                          28 2 13.7    . 100.3
                          23 2 10.4    .  82.9
                          14 2    8 74.7     .
                          35 2 12.7    .  92.5
                          47 2 15.8    .    99
                           7 2  7.2 72.1     .
                          36 2 12.4    .  92.2
                          36 2 11.6    .  90.4
                          20 2   11    .  81.6
                           . 2 11.4   75     .
                           9 2    8   67     .
                          48 2    .    .     .
                          52 2   15    . 102.2
                          30 2    .    .     .
                          55 2   13    .  97.3
                          14 2  9.4    .  73.6
                          50 2 17.2    . 106.3
                          27 2  9.9    .  84.5
                          56 2 16.4    .   110
                          23 2 11.5    .  83.8
                          44 .    .    .     .
                           8 .    .    .     .
                          12 2  8.2   68     .
                          46 2 15.9    . 101.1
                          42 2 13.2    .  96.1
                          26 2 12.2    .  84.5
                          40 2 12.6    .  92.5
                          48 2   17    . 104.6
                          20 2  8.2 90.9     .
                          23 2   13    .  86.5
                          29 1 12.2    .  90.3
                           6 .    .    .     .
                           8 2  8.5   69     .
                          31 2 11.6    .  88.1
                          53 2 20.2    . 102.4
                          28 .    .    .     .
                          36 .   14    . 100.6
                          13 .  8.7 76.2     .
                          36 .    .    .     .
                          12 .  9.6 74.2     .
                          40 .    .    .     .
                          33 2 12.3    .  89.2
                           6 2  7.8 68.3     .
                          49 2 16.2    . 107.5
                          12 2 10.9    .    72
                          43 2    .    .     .
                          35 2    .    .     .
                          27 2 17.2    .  97.8
                          23 2 11.8    .  81.2
                          28 2 14.2    .  87.5
                          18 2  9.5    .  78.5
                          40 2 14.5    .  97.7
                          10 2  7.7    .    67
                          36 2 14.4 95.9     .
                          29 2 13.4    .  86.4
                          56 2 14.7    .  98.3
                          16 .    .    .     .
                          47 2 14.7    . 100.8
                          42 2    .    .     .
                          30 2 16.8    .  96.3
                          53 2 14.7    .  95.2
                          53 2 12.7    .    91
                          36 2   12    .  87.5
                          17 2  7.4 67.5     .
                          54 2 15.5    . 100.5
                          47 2    .    .     .
                          30 2  9.8    .  73.3
                          26 2 13.7    .  87.8
                           8 2    7 68.9     .
                          20 2  9.8 83.4     .
                          11 2  9.2 74.5     .
                          48 2  9.9 81.5     .
                          16 2  8.3 67.6     .
                          39 2 14.6    .  96.1
                          end
                          label values Oedema H6Q26
                          label def H6Q26 1 "Yes", modify
                          label def H6Q26 2 "No", modify
                          ------------------ copy up to and including the previous line ------------------

                          Comment


                          • #14
                            As indicated in post #9 by Patrick, install the z-anthro package (type- findit zanthro). You also need the child gender variable in the model. Once installed, the help file is simple to understand and to implement. For example based on your data with UK reference, the command for HA zscore will be:


                            Code:
                            gen sex = runiform()>.5 //Artificial gender for child
                            
                            
                            
                            egen zhauk1 = zanthro(height,ha,UK), xvar(child_age) ///
                            gender(sex) gencode(male=0, female=1) ageunit(month)
                            
                            
                            su zhauk1
                            
                                Variable |        Obs        Mean    Std. Dev.       Min        Max
                            -------------+---------------------------------------------------------
                                  zwauk1 |         56   -.4970381    1.425628  -3.358466   4.474649
                            Roman

                            Comment


                            • #15
                              Thanks Roman! But I was hoping to use the WHO 2006 reference for HAZ and WHZ. My data is from Uganda and I was hoping to use zscore06 command if possible?

                              I have tried the command zscore06, a(hc1) s( hc27) w( hc2) h(hc3) above but not sure the numbers I generated are correct?

                              Thanks again!

                              Comment

                              Working...
                              X