Announcement

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

  • How to calculate median of 5 year Age category of 15-49 year women sample in DHS

    Dear Statalist

    May I request how to calculate for Median of 5 year age category of 15-49 year women sample in Demographic and Health Survey ?

    With regards
    Sein

  • #2
    The correct code will depend on the specifics of how your data is organized. Please post back with an example of your data, using the -dataex- command. If you are running version 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    When asking for help with code, always show example data. When showing example data, always use -dataex-.

    Comment


    • #3
      Dear Clyde
      Thanks so much for your guidance and recommendation on dataex.
      pls let me post the following example data of 5 year age group of women sample from DHS for calculating Median value.

      ----------------------- copy starting from the next line -----------------------
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input double V013
      7
      3
      5
      3
      4
      6
      7
      3
      6
      2
      4
      7
      4
      3
      5
      7
      6
      4
      3
      5
      2
      6
      4
      4
      4
      4
      5
      7
      7
      6
      7
      5
      5
      7
      2
      1
      7
      7
      7
      5
      6
      3
      7
      3
      4
      5
      6
      4
      2
      4
      6
      4
      2
      3
      4
      6
      4
      5
      3
      6
      6
      6
      3
      6
      7
      4
      4
      4
      3
      6
      5
      5
      4
      4
      4
      4
      6
      5
      3
      2
      5
      2
      3
      3
      6
      3
      5
      5
      6
      4
      3
      7
      2
      5
      3
      3
      4
      2
      6
      4
      end
      label values V013 V013
      label def V013 1 "15-19", modify
      label def V013 2 "20-24", modify
      label def V013 3 "25-29", modify
      label def V013 4 "30-34", modify
      label def V013 5 "35-39", modify
      label def V013 6 "40-44", modify
      label def V013 7 "45-49", modify
      ------------------ copy up to and including the previous line ------------------

      This is my first time of using dataex , hopefully this is in correct application.

      Pls have some more guidance for how to calculate the Median value.

      With Regards
      Sein Hlaing

      Comment


      • #4
        Code:
        centile V013, centile(50)
        is one way. There are several other ways to do this as well. I chose this one because I think it is the simplest and the syntax is the most expressive of the problem.

        Comment

        Working...
        X