Application of inverse probability weights in survival analysis