Announcement

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

  • Age adjusted mortality rate

    Hello! There are three variables in my database: pneumonia (yes / no), death (yes / no) and age (various categories). I need to show that patients with pneumonia die more often than without pneumonia adjusted for age (age adjusted mortality rate). How can I do it?
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(age death pneumonia)
    0 0 0
    0 0 0
    0 0 0
    1 0 0
    1 0 0
    1 0 0
    1 0 0
    2 1 1
    2 0 0
    2 0 0
    2 0 0
    5 0 0
    5 0 0
    5 0 0
    5 1 1
    5 1 1
    6 1 1
    6 1 1
    6 1 1
    6 0 0
    7 0 0
    7 1 0
    7 1 1
    7 1 0
    7 1 1
    8 1 0
    8 1 1
    8 1 1
    8 1 1
    8 1 1
    3 0 1
    3 0 1
    3 0 0
    3 0 0
    3 1 1
    4 0 1
    4 0 0
    4 1 1
    4 1 1
    4 0 1
    end
    label values age age
    label def age 0 "20-29", modify
    label def age 1 "30-39", modify
    label def age 2 "40-49", modify
    label def age 3 "50-59", modify
    label def age 4 "60-69", modify
    label def age 5 "70-79", modify
    label def age 6 "80-89", modify
    label def age 7 "90-99", modify
    label def age 8 "100-109", modify
    label values death death
    label def death 0 "no", modify
    label def death 1 "yes", modify
    label values pneumonia pneumonia
    label def pneumonia 0 "no", modify
    label def pneumonia 1 "yes", modify

  • #2
    Svetlana:
    as per your data structure, you should add a -timevar- in order to exploit a, say, semi-parametric survival analysis regression model (eg, -stcox) and interact -i-age- with -i.pneumonia- to try to investigate the evidence (not to show) that -i.pneumonia-, when adjusted for -age- (by the way, see http://citeseerx.ist.psu.edu/viewdoc...=rep1&type=pdf about categorizing a continuous predictor like age) is an informative predictor of death (or not).
    A very unsatisfactory toy-example could be:
    Code:
    g timevar=1
    . stcox i.age##i.pneumonia
    
             failure _d:  death
       analysis time _t:  timevar
    
    note: 0.age#1.pneumonia identifies no observations in the sample
    note: 1.age#1.pneumonia identifies no observations in the sample
    note: 8.age#1.pneumonia omitted because of collinearity
    Iteration 0:   log likelihood =  -66.39983
    Iteration 1:   log likelihood = -57.481066
    Iteration 2:   log likelihood =  -55.97714
    Iteration 3:   log likelihood = -55.551738
    Iteration 4:   log likelihood = -55.406113
    Iteration 5:   log likelihood =  -55.35318
    Iteration 6:   log likelihood = -55.333791
    Iteration 7:   log likelihood =  -55.32667
    Iteration 8:   log likelihood = -55.324052
    Iteration 9:   log likelihood = -55.323089
    Iteration 10:  log likelihood = -55.322735
    Iteration 11:  log likelihood = -55.322604
    Iteration 12:  log likelihood = -55.322556
    Iteration 13:  log likelihood = -55.322539
    Iteration 14:  log likelihood = -55.322532
    Iteration 15:  log likelihood =  -55.32253
    Iteration 16:  log likelihood = -55.322529
    Iteration 17:  log likelihood = -55.322529
    Iteration 18:  log likelihood = -55.322529
    Iteration 19:  log likelihood = -55.322529
    Iteration 20:  log likelihood = -55.322529
    Iteration 21:  log likelihood = -55.322529
    Iteration 22:  log likelihood = -55.322529
    Iteration 23:  log likelihood = -55.322529
    Iteration 24:  log likelihood = -55.322529
    Iteration 25:  log likelihood = -55.322529
    Iteration 26:  log likelihood = -55.322529
    Iteration 27:  log likelihood = -55.322529
    Iteration 28:  log likelihood = -55.322529
    Iteration 29:  log likelihood = -55.322529
    Iteration 30:  log likelihood = -55.322529
    Iteration 31:  log likelihood = -55.322529
    Iteration 32:  log likelihood = -55.322529
    Iteration 33:  log likelihood = -55.322529
    Iteration 34:  log likelihood = -55.322529
    Iteration 35:  log likelihood = -55.322529
    Iteration 36:  log likelihood = -55.322529
    Iteration 37:  log likelihood = -55.322529
    Iteration 38:  log likelihood = -55.322529
    Iteration 39:  log likelihood = -55.322529
    Refining estimates:
    Iteration 0:   log likelihood = -55.322529
    Iteration 1:   log likelihood = -55.322529
    Iteration 2:   log likelihood = -55.322529
    Iteration 3:   log likelihood = -55.322529
    
    Cox regression -- Breslow method for ties
    
    No. of subjects =           40                  Number of obs    =          40
    No. of failures =           18
    Time at risk    =           40
                                                    LR chi2(9)       =       22.15
    Log likelihood  =   -55.322529                  Prob > chi2      =      0.0084
    
    -------------------------------------------------------------------------------
               _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    --------------+----------------------------------------------------------------
              age |
           30-39  |   1.52e-08   19.43198    -0.00   1.000            0           .
           40-49  |   2.718279          .        .       .            .           .
           50-59  |   2.718281    3.84423     0.71   0.480     .1700253    43.45854
           60-69  |   20.08549   24.59961     2.45   0.014     1.821285    221.5069
           70-79  |   7.389048   9.049698     1.63   0.102     .6700138    81.48791
           80-89  |   148.4128   171.3723     4.33   0.000     15.43791    1426.771
           90-99  |   6.61e+10   1.10e+11    15.02   0.000     2.56e+09    1.71e+12
         100-109  |   9.92e+10   1.11e+11    22.65   0.000     1.11e+10    8.87e+11
                  |
        pneumonia |
             yes  |          1   1.118034     0.00   1.000     .1117706    8.946893
                  |
    age#pneumonia |
       20-29#yes  |          1  (empty)
       30-39#yes  |          1  (empty)
       40-49#yes  |   3.65e+10          .        .       .            .           .
       50-59#yes  |   1.22e+10          .        .       .            .           .
       60-69#yes  |   2.47e+09          .        .       .            .           .
       70-79#yes  |   1.34e+10          .        .       .            .           .
       80-89#yes  |   6.68e+08          .        .       .            .           .
       90-99#yes  |        1.5       2.25     0.27   0.787     .0793029    28.37224
     100-109#yes  |          1  (omitted)
    -------------------------------------------------------------------------------
    
    .
    Had you the number of deaths, you could consider -poisson-.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment

    Working...
    X