Fit parametric model for selected subjects
fit_model(dat, reason, impute, imputation_model = c("weibull", "exponential"))data.frame with flags and fitted model parameters to be used for imputation
data.frame containing at least 5 columns: TRT01P (treatment arm as factor), AVAL (survival time), EVENT (event indicator), CNSRRS (censoring reason) and MAXAVAL (maximum potential survival time, duration between randomization to data cut-off)
a string specifying the censoring reasons which require imputation. It must be one of the reasons from column CNSRRS.
a string specifying the treatment arm(s) which require imputation. It must be one of the arms from column TRT01P.
a string specifying the parametric distribution used for imputation, can be "Weibull" or "exponential".
The data.frame contains original columns, plus the following columns appended:
| AVAL4 | Placeholder column to keep imputed survival times |
| EVENT4 | Placeholder column to keep imputed events |
| impute | Flag indicating whether the subject was selected for imputation |
| a | Shape parameter, equal to 1 if exponential |
| b | Scale parameter |
| cdf | Cumulative distribution function |
| ... | Some temporary columns |