Announcement

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

  • Compute Estimated Hazard and Plot Estimated Hazard Curve after Fitting a xtmelogit Survival Model in Stata

    The dataset is presented below,

    insheet using "https://stats.idre.ucla.edu/stat/data/hdp.csv", comma
    foreach i of varlist familyhx smokinghx sex cancerstage school {
    encode `i', gen(`i'2)
    drop `i'
    rename `i'2 `i'
    }
    ssc inst center,all replace
    center co2 il6 crp lengthofstay

    I want to fit a survival model with the interaction term between the quadratic time variable (canerstage) and a continuous variable (co2) as follows,

    xtmelogit remission c.c_il6 c.c_crp c.c_lengthofstay i.sex i.sex#c.cancerstage c.cancerstage c.c_co2 c.cancerstage#c.c_co2 c.cancerstage#c.cancerstage#c.c_co2 c.cancerstage#c.cancerstage#i.sex|| did:, intpoints(10) or

    Now, I want to graph the estimated hazard curve showing the effect of co2 in the manner (Mean-1*SD,Mean, Mean+1*SD) while holding all other variables at their mean in Stata.

    Thanks for your code or any hint!
    Last edited by smith Jason; 03 Jun 2022, 14:00.

  • #2
    Feel deep depressed........

    Comment


    • #3
      This paper definitely illustrates that how to use logit and melogit model to build multilevel discrete-time survival models on page 316.
      I just don't know how to compute the estimated hazard and plot the estimated hazard curve after fitting a multilevel discrete-time model with the interaction terms of linear time and quadratic time term with covariates at each level. Thank you for someone can help me here!
      Attached Files
      Last edited by smith Jason; 05 Jun 2022, 16:14.

      Comment

      Working...
      X