statsmodels.duration.hazard_regression.PHRegResults.predict#

PHRegResults.predict(endog=None, exog=None, strata=None, offset=None, transform=True, pred_type='lhr')[source]#

Returns predicted values from the proportional hazards regression model

Parameters:
exogarray_like, optional

Data to use as exog in forming predictions. If not provided, the exog values from the model used to fit the data are used.

endogarray_like, optional

Duration (time) values at which the predictions are made. Only used if pred_type is either ‘cumhaz’ or ‘surv’. If using model exog, defaults to model endog (time), but may be provided explicitly to make predictions at alternative times.

strataarray_like, optional

A vector of stratum values used to form the predictions. Not used (may be ‘None’) if pred_type is ‘lhr’ or ‘hr’. If exog is None, the model stratum values are used. If exog is not None and pred_type is ‘surv’ or ‘cumhaz’, stratum values must be provided (unless there is only one stratum).

offsetarray_like, optional

Offset values used to create the predicted values.

pred_type{‘lhr’, ‘hr’, ‘surv’, ‘cumhaz’}, optional

If ‘lhr’, returns log hazard ratios, if ‘hr’ returns hazard ratios, if ‘surv’ returns the survival function, if ‘cumhaz’ returns the cumulative hazard function.

transformbool, optional

If the model was fit via a formula, whether to pass exog through the formula before forming the prediction.

Returns:
Bunch

A bunch containing two fields: predicted_values and standard_errors.

Notes

Standard errors are only returned when predicting the log hazard ratio (pred_type is ‘lhr’).

Types surv and cumhaz require estimation of the cumulative hazard function.