Announcement

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

  • How to compute the OR for 30 or 10 unit increase of a continuous predictor

    Hello everyone,
    I would like to ask a question about computing the OR in logistic regression analysis.
    I am running a logistic regression model to predict mortality (the outcome), using categorical and continuous variables. In my continuous variables, I have "time delay from diagnosis" variable which is expressed in minutes. When I run the logistic regression, I get OR for every increase in 1 unit of time, but I would like to get the OR for 30 min delay in time, because 1 minute delay is not meaningful in the context of my analysis.
    I think I will need to generate a new variable, but I don't know what’s the correct command for that.
    Same question for age (years, continuous variable) if I want to compute the OR per 10 years increase and not 1 year.
    Thank you for your help

  • #2
    Code:
    gen newvar=oldvar/30
    or by 10 or ...

    Comment


    • #3
      Thanks Rich for your reply,
      Does it make sense to use this code as well:
      gen newvar= (oldvar + 30)

      Comment


      • #4
        no, it does not; the unit will still be exactly as it was before adding the 30 which is not what you asked for in #1

        Comment


        • #5
          Thank you.

          Comment


          • #6
            You can also do things like

            Code:
            webuse nhanes2f, clear
            logit diabetes height weight, or
            di 1.03062^30
            Or, to be really precise,

            Code:
            di exp(_b[weight]) ^ 30
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 19.5 MP (2 processor)

            EMAIL: [email protected]
            WWW: https://www3.nd.edu/~rwilliam

            Comment


            • #7
              If you use -lincom-, you'll SEs and CIs too.

              Code:
              clear
              webuse nhanes2f
              logit diabetes height weight
              // Get coefficient for weight via -lincom-
              lincom weight
              
              // Let wt30 = weight/30
              generate wt30 = weight/30
              logit diabetes height wt30
              lincom wt30
              
              // Estimate the original model again, and then
              // use lincom to get the coefficient for wt30
              quietly logit diabetes height weight
              lincom 30*weight
              // Add eform option to lincom to get odds ratios
              // OR for a 1 kg increase in weight
              lincom weight, eform
              // OR for a 10 kg increase in weight
              lincom 10*weight, eform
              // OR for a 20 kg increase in weight
              lincom 20*weight, eform
              // OR for a 30 kg increase in weight
              lincom 30*weight, eform
              --
              Bruce Weaver
              Email: [email protected]
              Version: Stata/MP 18.5 (Windows)

              Comment

              Working...
              X