CountResults.get_margeff()

statsmodels.discrete.discrete_model.CountResults.get_margeff CountResults.get_margeff(at='overall', method='dydx', atexog=None, dummy=False, count=False) Get marginal effects of the fitted model. Parameters: at : str, optional Options are: ?overall?, The average of the marginal effects at each observation. ?mean?, The marginal effects at the mean of each regressor. ?median?, The marginal effects at the median of each regressor. ?zero?, The marginal effects at zero for each regressor. ?all?

Poisson.fitted()

statsmodels.genmod.families.family.Poisson.fitted Poisson.fitted(lin_pred) Fitted values based on linear predictors lin_pred. Parameters: lin_pred : array Values of the linear predictor of the model. dot(X,beta) in a classical linear model. Returns: mu : array The mean response variables given by the inverse of the link function.

LogTransf_gen.var()

statsmodels.sandbox.distributions.transformed.LogTransf_gen.var LogTransf_gen.var(*args, **kwds) Variance of the distribution 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 scale parameter (default=1) Returns: var : float the variance of the distribution

NonlinearIVGMM.gradient_momcond()

statsmodels.sandbox.regression.gmm.NonlinearIVGMM.gradient_momcond NonlinearIVGMM.gradient_momcond(params, epsilon=0.0001, centered=True) gradient of moment conditions Parameters: params : ndarray parameter at which the moment conditions are evaluated epsilon : float stepsize for finite difference calculation centered : bool This refers to the finite difference calculation. If centered is true, then the centered finite difference calculation is used. Otherwise the one-sided forward dif

Gamma.resid_anscombe()

statsmodels.genmod.families.family.Gamma.resid_anscombe Gamma.resid_anscombe(endog, mu) [source] The Anscombe residuals for Gamma exponential family distribution Parameters: endog : array Endogenous response variable mu : array Fitted mean response variable Returns: resid_anscombe : array The Anscombe residuals for the Gamma family defined below Notes resid_anscombe = 3*(endog**(1/3.)-mu**(1/3.))/mu**(1/3.)

Binomial.resid_anscombe()

statsmodels.genmod.families.family.Binomial.resid_anscombe Binomial.resid_anscombe(endog, mu) [source] The Anscombe residuals Parameters: endog : array-like Endogenous response variable mu : array-like Fitted mean response variable Returns: resid_anscombe : array The Anscombe residuals as defined below. Notes sqrt(n)*(cox_snell(endog)-cox_snell(mu))/(mu**(1/6.)*(1-mu)**(1/6.)) where cox_snell is defined as cox_snell(x) = betainc(2/3., 2/3., x)*betainc(2/3.,2/3.) where betainc is th

MixedLMResults.predict()

statsmodels.regression.mixed_linear_model.MixedLMResults.predict MixedLMResults.predict(exog=None, transform=True, *args, **kwargs) Call self.model.predict with self.params as the first argument. Parameters: exog : array-like, optional The values for which you want to predict. transform : bool, optional If the model was fit via a formula, do you want to pass exog through the formula. Default is True. E.g., if you fit a model y ~ log(x1) + log(x2), and transform is True, then you can pass

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

Discrete Choice Models Overview

Discrete Choice Models Overview Link to Notebook GitHub In [1]: from __future__ import print_function import numpy as np import statsmodels.api as sm Data Load data from Spector and Mazzeo (1980). Examples follow Greene's Econometric Analysis Ch. 21 (5th Edition). In [2]: spector_data = sm.datasets.spector.load() spector_data.exog = sm.add_constant(spector_data.exog, prepend=False) Inspect the data: In [3]: print(spector_data.exog[:5,:]) print(spector_d

MixedLM.initialize()

statsmodels.regression.mixed_linear_model.MixedLM.initialize MixedLM.initialize() Initialize (possibly re-initialize) a Model instance. For instance, the design matrix of a linear model may change and some things must be recomputed.