Announcement

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

  • standardize BMI over age group and then run quantile regression

    How do I standardize the BMI over age groups to create a BMI z score and then run a quantile regression?

    This is the code i used for non-standardized BMI
    Code:
    foreach c in 10 25 50 75 90{
        bootstrap, reps(999) : rifhdreg BMI treated  , rif(q(`i')) abs(HHPBASE SURVEY COTOTAL5 EW9  district_id#c.SURVEY) cluster(IDPSU)
        eststo q`i'
        }

    Listed 100 out of 19421 observations
    Use the count() option to list more

    . dataex BMI treated age

    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(BMI treated) int age
     23.17475 0 40
    29.602175 0 33
     25.46452 0 26
     23.49591 0 33
     24.63776 1 47
     20.61365 1 42
    16.829824 1 39
     23.42016 1 56
     16.97294 0 28
     20.89844 0 35
      30.0864 0 29
     31.99797 1 36
    28.358147 0 35
     23.85799 0 42
     21.52873 1 35
    25.561056 1 42
     21.99219 1 47
     22.47699 0 40
     19.98344 0 29
    21.733334 0 22
     25.13861 1 39
     29.13409 1 53
    20.148024 1 34
    18.203485 0 27
     21.77648 1 40
    25.764605 0 33
     29.29406 1 49
    10.683762 1 34
    26.414253 1 55
    14.327621 1 48
      23.6671 0 35
    19.058865 0 28
    21.426653 1 49
     23.21406 1 52
      25.7553 0 39
    22.221287 0 25
    26.074083 1 54
    16.210938 1 42
     19.51093 0 28
     21.75343 0 21
    22.852877 1 47
    27.140844 1 46
     24.06643 0 39
     25.60617 1 45
     23.15688 0 25
    23.684183 0 30
    21.395906 1 42
    22.192595 1 47
    15.231208 1 52
    23.702597 1 43
     21.55471 0 29
     18.02873 1 35
    19.060251 1 52
     28.56713 0 43
     29.56929 0 49
     31.92075 0 33
     29.38885 0 27
    19.285105 1 52
    20.625706 0 36
    22.902575 0 29
    17.975086 1 45
    18.076817 0 36
     22.96625 0 43
     26.92532 1 50
    25.838005 1 39
     27.09817 1 51
      21.5625 0 30
     24.66638 0 34
     21.91004 1 47
    19.214306 1 52
       26.074 1 47
    21.515976 1 35
     30.93434 1 45
     31.52137 1 43
     26.20687 1 50
     21.11217 1 45
     26.71052 0 37
    25.190445 0 30
    17.962257 0 26
    24.156216 0 33
    24.969816 1 45
    24.221455 1 49
     17.07068 1 55
      21.5888 0 42
    35.761723 1 49
     25.01561 0 35
    24.667496 0 42
    18.897823 1 42
    19.063108 1 45
     28.56986 1 55
     21.82271 1 50
      23.4566 1 43
    23.680254 1 42
     23.51915 1 42
     24.60118 1 35
     39.59719 1 47
     24.21429 1 42
    28.983206 1 47
     34.25031 1 45
    27.985754 1 50
    end
    ------------------ copy up to and including the previous line ------------------

    Listed 100 out of 19421 observations
    Use the count() option to list more



  • #2
    How do I standardize the BMI over age groups to create a BMI z score
    Its not clear what you mean by age groups, but if you mean "group by age" then:

    Code:
    bysort age: egen std_bmi = std(BMI)

    Comment

    Working...
    X