Announcement

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

  • Inverse probability weights for continuous variable before survival analysis

    Hello,

    I would like to reweight the observations in my analysis using inverse probability weighting based on a continuous variable called time_interval. This should then help weigh the covariates in the subsequent Cox regression analysis.


    The below code works but I would like to be sure that I did it properly.

    regress time_interval ages sex bmi
    predict p_time_interval
    gen w=.
    replace w=1/p_time_interval
    summarize w

    stset duration2[pweight=w], failure(infection==1)
    Last edited by spencer keene; 10 Nov 2022, 08:40.

  • #2
    Just to add that I have a similar question to this: Inverse Probability Weights - Statalist but just wondering if I can use a continuous variable (time_interval) instead of a binary one (insampm)

    Comment

    Working...
    X