PHRegResults.predict()

statsmodels.duration.hazard_regression.PHRegResults.predict PHRegResults.predict(endog=None, exog=None, strata=None, offset=None, pred_type='lhr') [source] Returns predicted values from the fitted proportional hazards regression model. Parameters: params : array-;like The proportional hazards model parameters. 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 model endog (time

PHRegResults.get_distribution()

statsmodels.duration.hazard_regression.PHRegResults.get_distribution PHRegResults.get_distribution() [source] Returns a scipy distribution object corresponding to the distribution of uncensored endog (duration) values for each case. Returns: A list of objects of type scipy.stats.distributions.rv_discrete : Notes The distributions are obtained from a simple discrete estimate of the survivor function that puts all mass on the observed failure times wihtin a stratum.

PHRegResults.f_test()

statsmodels.duration.hazard_regression.PHRegResults.f_test PHRegResults.f_test(r_matrix, cov_p=None, scale=1.0, invcov=None) Compute the F-test for a joint linear hypothesis. This is a special case of wald_test that always uses the F distribution. Parameters: r_matrix : array-like, str, or tuple array : An r x k array where r is the number of restrictions to test and k is the number of regressors. It is assumed that the linear combination is equal to zero. str : The full hypotheses to test

PHRegResults.initialize()

statsmodels.duration.hazard_regression.PHRegResults.initialize PHRegResults.initialize(model, params, **kwd)

PHRegResults.cov_params()

statsmodels.duration.hazard_regression.PHRegResults.cov_params PHRegResults.cov_params(r_matrix=None, column=None, scale=None, cov_p=None, other=None) Returns the variance/covariance matrix. The variance/covariance matrix can be of a linear contrast of the estimates of params or all params multiplied by scale which will usually be an estimate of sigma^2. Scale is assumed to be a scalar. Parameters: r_matrix : array-like Can be 1d, or 2d. Can be used alone or with other. column : array-lik

PHRegResults.conf_int()

statsmodels.duration.hazard_regression.PHRegResults.conf_int PHRegResults.conf_int(alpha=0.05, cols=None, method='default') Returns the confidence interval of the fitted parameters. Parameters: alpha : float, optional The significance level for the confidence interval. ie., The default alpha = .05 returns a 95% confidence interval. cols : array-like, optional cols specifies which confidence intervals to return method : string Not Implemented Yet Method to estimate the confidence_interv

PHReg.weighted_covariate_averages()

statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages PHReg.weighted_covariate_averages(params) [source] Returns the hazard-weighted average of covariate values for subjects who are at-risk at a particular time. Parameters: params : ndarray Parameter vector Returns: averages : list of ndarrays averages[stx][i,:] is a row vector containing the weighted average values (for all the covariates) of at-risk subjects a the i^th largest observed failure time in stratum stx,

PHReg.score_residuals()

statsmodels.duration.hazard_regression.PHReg.score_residuals PHReg.score_residuals(params) [source] Returns the score residuals calculated at a given vector of parameters. Parameters: params : ndarray The parameter vector at which the score residuals are calculated. Returns: The score residuals, returned as a ndarray having the same : shape as `exog`. : Notes Observations in a stratum with no observed events have undefined score residuals, and contain NaN in the returned matrix.

PHReg.predict()

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 params vector, used to obtain prediction errors if pred_type=?lhr?, otherwise optional. endog : array-like Durat

PHReg.robust_covariance()

statsmodels.duration.hazard_regression.PHReg.robust_covariance PHReg.robust_covariance(params) [source] Returns a covariance matrix for the proportional hazards model regresion coefficient estimates that is robust to certain forms of model misspecification. Parameters: params : ndarray The parameter vector at which the covariance matrix is calculated. Returns: The robust covariance matrix as a square ndarray. : Notes This function uses the groups argument to determine groups within whi