Announcement

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

  • find information at 95% centile if female or male

    Hi I would like to find the values of m25 at the 95th centile, 50th centile, 25th centile and 5th centile

    I can get these if I insert

    Code:
    sum m25, detail
    However if I want the above values but for those who are male or female in each ethnicity category. How would I do this?

    I tried

    Code:
    pctile percentage = m25 nq(4)
    However the values are different from sum m25, detail


    Here's a sample of the data


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int age double(bodymassindex pfirmann_cch pfirmann_mch pfirmann_lch m25 m26 m27 m28 m29 m30) long(ptid ethnicity gender) float(pfirmann percentage)
    57  24.034609838167 56.7 59.9 60.3 111.2 163.6 11.1 14.2 169.8  7.6 590 1 1  3.4 108.9
    26          23.4375 55.8 57.8 60.9 114.3   167 10.6 11.8 166.5    2 245 1 1 3.55 114.3
    78 26.1224489795918 64.6 67.4 70.1 115.5 160.7 11.4  4.8 164.9 14.6 602 1 2 4.15 120.8
    26          23.4375 54.3 55.7 61.4 121.8 159.1  8.6  6.9 161.5  5.6 245 1 1 4.25     .
    75 29.1545189504373 51.3 54.8   57 118.5   152 13.4   .4 161.8  7.9 581 1 1  4.6     .
    57          39.0625 50.4 54.4 55.7 107.5 152.8   13    7   164  7.5 234 1 1 4.65     .
    78 26.1224489795918 63.9 67.1 70.1   111   158 13.3  4.9 163.2  3.2 602 1 2  4.7     .
    57  24.034609838167 55.8 59.7 61.4 108.9 155.2 12.1 10.3 164.1  1.1 590 1 1 4.75     .
    66        25.390625 58.4 62.9 63.8 124.8 157.3 10.7  5.2 165.8  8.2 599 1 2 4.95     .
    75 29.1545189504373   50 54.2   56 117.1 150.1 12.6    5 161.3  4.7 581 1 1  5.1     .
    end
    label values ptid ptid
    label def ptid 234 "2430", modify
    label def ptid 245 "2442", modify
    label def ptid 581 "50388", modify
    label def ptid 590 "50401", modify
    label def ptid 599 "50418", modify
    label def ptid 602 "50422", modify
    label values ethnicity ethnicity
    label def ethnicity 1 "African", modify
    label values gender gender
    label def gender 1 "f", modify
    label def gender 2 "m", modify

  • #2
    See egen's pctile() function or tabstat.

    Comment


    • #3
      thanks tabstat works

      Comment

      Working...
      X