Announcement

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

  • Computing Relative Risk and Population Attributable Fraction of the interaction term

    My dependent variable is Diabetes ("1" for Yes and "0" for No).

    Independent variables are age, sex, smoking, alcohol, paan, obesity

    I apply a logistic regression model, and I want to calculate the relative risk (RR) and population attributable fraction (PAF) of the interaction term.

    This is my data
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(Diabetes age) byte sex float(smoking alcohl paan obesity)
    0 24 1 0 0 1 0
    0 34 1 0 1 0 1
    0 16 1 0 0 0 0
    0 28 1 0 0 0 0
    0 23 1 0 0 1 0
    0 21 1 0 0 0 0
    0 28 1 0 1 0 0
    0 30 1 0 1 0 1
    0 26 1 0 0 0 1
    0 46 1 0 0 1 1
    0 18 1 0 0 0 0
    0 32 1 0 0 0 1
    0 42 1 0 0 0 1
    0 36 1 0 0 0 0
    0 33 1 0 1 1 1
    0 38 1 0 0 0 1
    0 21 1 0 0 0 0
    0 37 1 0 0 0 1
    0 22 1 0 0 0 1
    0 27 1 0 0 0 1
    0 36 1 0 1 0 1
    0 25 1 0 0 0 0
    0 26 1 0 0 0 1
    . 36 1 0 0 0 1
    0 16 1 0 0 0 0
    0 30 1 0 0 0 1
    . 19 1 0 0 0 .
    . 40 1 0 0 0 0
    0 18 1 0 0 0 0
    0 17 1 0 0 0 1
    0 43 1 0 0 0 0
    0 19 1 0 1 0 0
    0 45 1 0 0 0 1
    0 21 1 0 0 0 0
    0 18 1 0 0 0 0
    0 16 1 0 0 0 0
    0 15 1 0 0 0 1
    0 25 1 0 0 0 0
    0 21 1 0 0 0 0
    0 49 1 0 0 0 1
    0 24 1 0 0 0 1
    0 22 1 0 0 0 1
    0 15 1 0 0 0 0
    0 31 1 0 0 0 1
    0 33 1 0 0 0 1
    0 29 1 0 0 0 1
    0 16 1 0 0 0 0
    0 16 1 0 0 0 0
    0 48 1 0 0 0 0
    0 26 1 0 0 0 1
    0 48 1 0 0 0 0
    0 22 1 0 1 0 0
    0 26 1 0 0 0 1
    0 35 1 0 0 0 1
    0 47 1 0 0 1 1
    0 49 1 0 1 0 1
    1 40 1 0 0 0 1
    0 32 1 0 0 0 0
    0 38 1 0 0 0 1
    0 22 1 0 1 0 0
    0 38 1 0 0 0 1
    0 49 1 0 0 0 0
    0 16 1 0 0 0 0
    1 47 1 0 0 0 1
    0 16 1 0 0 0 0
    0 36 1 0 0 0 1
    0 15 1 0 0 0 0
    0 26 1 0 1 0 0
    0 45 1 0 1 0 1
    0 39 1 0 0 0 0
    0 16 1 0 0 0 0
    0 15 1 0 0 0 0
    0 25 1 0 0 0 0
    1 18 1 0 0 0 0
    0 15 1 0 0 0 0
    0 26 1 0 0 0 0
    0 33 1 0 1 0 0
    0 26 1 0 0 0 0
    0 27 1 0 1 0 1
    0 31 1 0 1 1 0
    0 23 1 0 0 0 1
    0 38 1 0 1 1 0
    0 38 1 0 0 0 1
    0 38 1 0 1 0 0
    0 22 1 0 0 0 0
    0 31 1 0 0 0 1
    . 37 1 0 0 0 0
    0 22 0 0 0 0 0
    0 45 1 0 0 0 .
    0 32 0 0 1 0 0
    . 25 1 0 0 0 0
    0 45 1 0 0 0 .
    0 38 1 0 0 0 0
    0 20 1 0 0 0 0
    0 28 0 1 1 1 0
    0 31 1 0 0 0 0
    0 16 1 0 0 0 1
    0 35 0 0 0 0 0
    0 35 0 0 0 0 1
    0 33 1 0 1 0 1
    end
    label values Diabetes Diabetes
    label def Diabetes 0 "no diabetes", modify
    label def Diabetes 1 "diabetes", modify
    label values sex sex
    label def sex 0 "male", modify
    label def sex 1 "female", modify
    This is the syntax
    Code:
    logit Diabetes age i.sex i.smoking#alcohl#paan#obesity, nolog allbase
    What is the command to calculate RR and PAF for the interaction term?
Working...
X