statsmodels.regression.linear_model.RegressionResults¶
-
class
statsmodels.regression.linear_model.RegressionResults(model, params, normalized_cov_params=None, scale=1.0, cov_type='nonrobust', cov_kwds=None, use_t=None, **kwargs)[source]¶ This class summarizes the fit of a linear regression model.
It handles the output of contrasts, estimates of covariance, etc.
Parameters: model : RegressionModel
The regression model instance.
params : ndarray
The estimated parameters.
normalized_cov_params : ndarray
The normalized covariance parameters.
scale : float
The estimated scale of the residuals.
cov_type : str
The covariance estimator used in the results.
cov_kwds : dict
Additional keywords used in the covariance specification.
use_t : bool
Flag indicating to use the Student’s t in inference.
**kwargs
Additional keyword arguments used to initialize the results.
Attributes
pinv_wexog See model class docstring for implementation details. cov_type Parameter covariance estimator used for standard errors and t-stats. df_model Model degrees of freedom. The number of regressors p. Does not include the constant if one is present. df_resid Residual degrees of freedom. n - p - 1, if a constant is present. n - p if a constant is not included. het_scale adjusted squared residuals for heteroscedasticity robust standard errors. Is only available after HC#_se or cov_HC# is called. See HC#_se for more information. history Estimation history for iterative estimators. model A pointer to the model instance that called fit() or results. params The linear coefficients that minimize the least squares criterion. This is usually called Beta for the classical linear model. Methods
compare_f_test(restricted)Use F test to test whether restricted model is correct. compare_lm_test(restricted[, demean, use_lr])Use Lagrange Multiplier test to test a set of linear restrictions. compare_lr_test(restricted[, large_sample])Likelihood ratio test to test whether restricted model is correct. conf_int([alpha, cols])Compute the confidence interval of the fitted parameters. cov_params([r_matrix, column, scale, cov_p, …])Compute the variance/covariance matrix. f_test(r_matrix[, cov_p, scale, invcov])Compute the F-test for a joint linear hypothesis. get_prediction([exog, transform, weights, …])Compute prediction results. get_robustcov_results([cov_type, use_t])Create new results instance with robust covariance as default. initialize(model, params, **kwargs)Initialize (possibly re-initialize) a Results instance. load(fname)Load a pickled results instance normalized_cov_params()See specific model class docstring predict([exog, transform])Call self.model.predict with self.params as the first argument. remove_data()Remove data arrays, all nobs arrays from result and model. save(fname[, remove_data])Save a pickle of this instance. scale()A scale factor for the covariance matrix. summary([yname, xname, title, alpha])Summarize the Regression Results. summary2([yname, xname, title, alpha, …])Experimental summary function to summarize the regression results. t_test(r_matrix[, cov_p, scale, use_t])Compute a t-test for a each linear hypothesis of the form Rb = q. t_test_pairwise(term_name[, method, alpha, …])Perform pairwise t_test with multiple testing corrected p-values. wald_test(r_matrix[, cov_p, scale, invcov, …])Compute a Wald-test for a joint linear hypothesis. wald_test_terms([skip_single, …])Compute a sequence of Wald tests for terms over multiple columns. Methods
compare_f_test(restricted)Use F test to test whether restricted model is correct. compare_lm_test(restricted[, demean, use_lr])Use Lagrange Multiplier test to test a set of linear restrictions. compare_lr_test(restricted[, large_sample])Likelihood ratio test to test whether restricted model is correct. conf_int([alpha, cols])Compute the confidence interval of the fitted parameters. cov_params([r_matrix, column, scale, cov_p, …])Compute the variance/covariance matrix. f_test(r_matrix[, cov_p, scale, invcov])Compute the F-test for a joint linear hypothesis. get_prediction([exog, transform, weights, …])Compute prediction results. get_robustcov_results([cov_type, use_t])Create new results instance with robust covariance as default. initialize(model, params, **kwargs)Initialize (possibly re-initialize) a Results instance. load(fname)Load a pickled results instance normalized_cov_params()See specific model class docstring predict([exog, transform])Call self.model.predict with self.params as the first argument. remove_data()Remove data arrays, all nobs arrays from result and model. save(fname[, remove_data])Save a pickle of this instance. scale()A scale factor for the covariance matrix. summary([yname, xname, title, alpha])Summarize the Regression Results. summary2([yname, xname, title, alpha, …])Experimental summary function to summarize the regression results. t_test(r_matrix[, cov_p, scale, use_t])Compute a t-test for a each linear hypothesis of the form Rb = q. t_test_pairwise(term_name[, method, alpha, …])Perform pairwise t_test with multiple testing corrected p-values. wald_test(r_matrix[, cov_p, scale, invcov, …])Compute a Wald-test for a joint linear hypothesis. wald_test_terms([skip_single, …])Compute a sequence of Wald tests for terms over multiple columns. Properties
HC0_seWhite’s (1980) heteroskedasticity robust standard errors. HC1_seMacKinnon and White’s (1985) heteroskedasticity robust standard errors. HC2_seMacKinnon and White’s (1985) heteroskedasticity robust standard errors. HC3_seMacKinnon and White’s (1985) heteroskedasticity robust standard errors. aicAkaike’s information criteria. bicBayes’ information criteria. bseThe standard errors of the parameter estimates. centered_tssThe total (weighted) sum of squares centered about the mean. condition_numberReturn condition number of exogenous matrix. cov_HC0Heteroscedasticity robust covariance matrix. cov_HC1Heteroscedasticity robust covariance matrix. cov_HC2Heteroscedasticity robust covariance matrix. cov_HC3Heteroscedasticity robust covariance matrix. eigenvalsReturn eigenvalues sorted in decreasing order. essThe explained sum of squares. f_pvalueThe p-value of the F-statistic. fittedvaluesThe predicted values for the original (unwhitened) design. fvalueF-statistic of the fully specified model. llfLog-likelihood of model mse_modelMean squared error the model. mse_residMean squared error of the residuals. mse_totalTotal mean squared error. nobsNumber of observations n. pvaluesThe two-tailed p values for the t-stats of the params. residThe residuals of the model. resid_pearsonResiduals, normalized to have unit variance. rsquaredR-squared of the model. rsquared_adjAdjusted R-squared. ssrSum of squared (whitened) residuals. tvaluesReturn the t-statistic for a given parameter estimate. uncentered_tssUncentered sum of squares. use_tFlag indicating to use the Student’s distribution in inference. wresidThe residuals of the transformed/whitened regressand and regressor(s).