statsmodels.genmod.generalized_linear_model.GLMResults

class statsmodels.genmod.generalized_linear_model.GLMResults(model, params, normalized_cov_params, scale, cov_type='nonrobust', cov_kwds=None, use_t=None)[source]

Class to contain GLM results.

GLMResults inherits from statsmodels.LikelihoodModelResults

Attributes
df_modelfloat

See GLM.df_model

df_residfloat

See GLM.df_resid

fit_historydict

Contains information about the iterations. Its keys are iterations, deviance and params.

modelclass instance

Pointer to GLM model instance that called fit.

nobsfloat

The number of observations n.

normalized_cov_paramsarray

See specific model class docstring

paramsarray

The coefficients of the fitted model. Note that interpretation of the coefficients often depends on the distribution family and the data.

pvaluesarray

The two-tailed p values for the t-stats of the params.

scalefloat

The estimate of the scale / dispersion for the model fit. See GLM.fit and GLM.estimate_scale for more information.

stand_errorsarray

The standard errors of the fitted GLM. #TODO still named bse

Methods

aic()

Akaike Information Criterion -2 * llf + 2*(df_model + 1)

bic()

Bayes Information Criterion deviance - df_resid * log(nobs)

bse()

The standard errors of the parameter estimates.

conf_int([alpha, cols, method])

Returns the confidence interval of the fitted parameters.

cov_params([r_matrix, column, scale, cov_p, …])

Returns the variance/covariance matrix.

deviance()

See statsmodels.families.family for the distribution-specific deviance functions.

f_test(r_matrix[, cov_p, scale, invcov])

Compute the F-test for a joint linear hypothesis.

fittedvalues()

Linear predicted values for the fitted model.

get_hat_matrix_diag([observed])

Compute the diagonal of the hat matrix

get_influence([observed])

Get an instance of GLMInfluence with influence and outlier measures

get_prediction([exog, exposure, offset, …])

compute prediction results

initialize(model, params, **kwd)

Initialize (possibly re-initialize) a Results instance.

llf()

Value of the loglikelihood function evalued at params.

llnull()

Log-likelihood of the model fit with a constant as the only regressor

load(fname)

load a pickle, (class method)

mu()

See GLM docstring.

normalized_cov_params()

See specific model class docstring

null()

Fitted values of the null model

null_deviance()

The value of the deviance function for the model fit with a constant as the only regressor.

pearson_chi2()

Pearson’s Chi-Squared statistic is defined as the sum of the squares of the Pearson residuals.

plot_added_variable(focus_exog[, …])

Create an added variable plot for a fitted regression model.

plot_ceres_residuals(focus_exog[, frac, …])

Produces a CERES (Conditional Expectation Partial Residuals) plot for a fitted regression model.

plot_partial_residuals(focus_exog[, ax])

Create a partial residual, or ‘component plus residual’ plot for a fited regression model.

predict([exog, transform])

Call self.model.predict with self.params as the first argument.

pvalues()

The two-tailed p values for the t-stats of the params.

remove_data()

remove data arrays, all nobs arrays from result and model

resid_anscombe()

Anscombe residuals.

resid_anscombe_scaled()

Scaled Anscombe residuals.

resid_anscombe_unscaled()

Unscaled Anscombe residuals.

resid_deviance()

Deviance residuals.

resid_pearson()

Pearson residuals.

resid_response()

Respnose residuals.

resid_working()

Working residuals.

save(fname[, remove_data])

save a pickle of this instance

summary([yname, xname, title, alpha])

Summarize the Regression Results

summary2([yname, xname, title, alpha, …])

Experimental summary for 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

tvalues()

Return the t-statistic for a given parameter estimate.

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