calc_weights function

Calculate inverse probability of censoring weights at time t.