Regression Diagnostics and Specification Tests

Regression Diagnostics and Specification Tests Introduction In many cases of statistical analysis, we are not sure whether our statistical model is correctly specified. For example when using ols, then linearity and homoscedasticity are assumed, some test statistics additionally assume that the errors are normally distributed or that we have a large sample. Since our results depend on these statistical assumptions, the results are only correct of our assumptions hold (at least approximately).

OLSResults.summary2()

statsmodels.regression.linear_model.OLSResults.summary2 OLSResults.summary2(yname=None, xname=None, title=None, alpha=0.05, float_format='%.4f') Experimental summary function to summarize the regression results Parameters: xname : List of strings of length equal to the number of parameters Names of the independent variables (optional) yname : string Name of the dependent variable (optional) title : string, optional Title for the top table. If not None, then this replaces the default ti

NormExpan_gen.freeze()

statsmodels.sandbox.distributions.extras.NormExpan_gen.freeze NormExpan_gen.freeze(*args, **kwds) Freeze the distribution for the given arguments. Parameters: arg1, arg2, arg3,... : array_like The shape parameter(s) for the distribution. Should include all the non-optional arguments, may include loc and scale. Returns: rv_frozen : rv_frozen instance The frozen distribution.

Gaussian.resid_dev()

statsmodels.genmod.families.family.Gaussian.resid_dev Gaussian.resid_dev(endog, mu, scale=1.0) [source] Gaussian deviance residuals Parameters: endog : array-like Endogenous response variable mu : array-like Fitted mean response variable scale : float, optional An optional argument to divide the residuals by scale Returns: resid_dev : array Deviance residuals as defined below Notes resid_dev = (endog - mu)/sqrt(variance(mu))

SkewNorm_gen.stats()

statsmodels.sandbox.distributions.extras.SkewNorm_gen.stats SkewNorm_gen.stats(*args, **kwds) Some statistics of the given RV Parameters: arg1, arg2, arg3,... : array_like The shape parameter(s) for the distribution (see docstring of the instance object for more information) loc : array_like, optional location parameter (default=0) scale : array_like, optional (discrete RVs only) scale parameter (default=1) moments : str, optional composed of letters [?mvsk?] defining which moments t

static OLSResults.mse_model()

statsmodels.regression.linear_model.OLSResults.mse_model static OLSResults.mse_model()

genmod.families.links.cauchy

statsmodels.genmod.families.links.cauchy class statsmodels.genmod.families.links.cauchy [source] The Cauchy (standard Cauchy CDF) transform Notes g(p) = scipy.stats.cauchy.ppf(p) cauchy is an alias of CDFLink with dbn=scipy.stats.cauchy Methods deriv(p) Derivative of CDF link deriv2(p) Second derivative of the link function g??(p) inverse(z) The inverse of the CDF link inverse_deriv(z) Derivative of the inverse of the CDF transformation link function

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.

VARProcess.forecast_cov()

statsmodels.tsa.vector_ar.var_model.VARProcess.forecast_cov VARProcess.forecast_cov(steps) Compute theoretical forecast error variance matrices Parameters: steps : int Number of steps ahead Returns: forc_covs : ndarray (steps x neqs x neqs) Notes

Exchangeable.initialize()

statsmodels.genmod.cov_struct.Exchangeable.initialize Exchangeable.initialize(model) Called by GEE, used by implementations that need additional setup prior to running fit. Parameters: model : GEE class A reference to the parent GEE class instance.