statsmodels.duration.hazard_regression.PHReg.predict
-
PHReg.predict(params, cov_params=None, endog=None, exog=None, strata=None, offset=None, pred_type='lhr')[source] -
Returns predicted values from the proportional hazards regression model.
Parameters: params : array-like
The proportional hazards model parameters.
cov_params : array-like
The covariance matrix of the estimated
paramsvector, used to obtain prediction errors if pred_type=?lhr?, otherwise optional.endog : array-like
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 modelendog(time), but may be provided explicitly to make predictions at alternative times.exog : array-like
Data to use as
exogin forming predictions. If not provided, theexogvalues from the model used to fit the data are used.strata : array-like
A vector of stratum values used to form the predictions. Not used (may be ?None?) if pred_type is ?lhr? or ?hr?. If
exogis None, the model stratum values are used. Ifexogis not None and pred_type is ?surv? or ?cumhaz?, stratum values must be provided (unless there is only one stratum).offset : array-like
Offset values used to create the predicted values.
pred_type : string
If ?lhr?, returns log hazard ratios, if ?hr? returns hazard ratios, if ?surv? returns the survival function, if ?cumhaz? returns the cumulative hazard function.
Returns: 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
survandcumhazrequire estimation of the cumulative hazard function.
Please login to continue.