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)
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)
Comment