Contrasts Overview

Contrasts Overview Link to Notebook GitHub In [1]: from __future__ import print_function import numpy as np import statsmodels.api as sm This document is based heavily on this excellent resource from UCLA http://www.ats.ucla.edu/stat/r/library/contrast_coding.htm A categorical variable of K categories, or levels, usually enters a regression as a sequence of K-1 dummy variables. This amounts to a linear hypothesis on the level means. That is, each test statistic for these v

static ProbitResults.tvalues()

statsmodels.discrete.discrete_model.ProbitResults.tvalues static ProbitResults.tvalues() Return the t-statistic for a given parameter estimate.

OLS.fit_regularized()

statsmodels.regression.linear_model.OLS.fit_regularized OLS.fit_regularized(method='coord_descent', maxiter=1000, alpha=0.0, L1_wt=1.0, start_params=None, cnvrg_tol=1e-08, zero_tol=1e-08, **kwargs) Return a regularized fit to a linear regression model. Parameters: method : string Only the coordinate descent algorithm is implemented. maxiter : integer The maximum number of iteration cycles (an iteration cycle involves running coordinate descent on all variables). alpha : scalar or array-

Tools

Tools Our tool collection contains some convenience functions for users and functions that were written mainly for internal use. Additional to this tools directory, several other subpackages have their own tools modules, for example statsmodels.tsa.tsatools Module Reference Basic tools tools These are basic and miscellaneous tools. The full import path is statsmodels.tools.tools. tools.add_constant(data[, prepend, has_constant]) This appends a column of ones to an array if prepend==False.

SimpleTable.as_csv()

statsmodels.iolib.table.SimpleTable.as_csv SimpleTable.as_csv(**fmt_dict) [source] Return string, the table in CSV format. Currently only supports comma separator.

static OLSResults.nobs()

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

IVGMM.get_error()

statsmodels.sandbox.regression.gmm.IVGMM.get_error IVGMM.get_error(params) [source]

OLSResults.compare_lr_test()

statsmodels.regression.linear_model.OLSResults.compare_lr_test OLSResults.compare_lr_test(restricted, large_sample=False) Likelihood ratio test to test whether restricted model is correct Parameters: restricted : Result instance The restricted model is assumed to be nested in the current model. The result instance of the restricted model is required to have two attributes, residual sum of squares, ssr, residual degrees of freedom, df_resid. large_sample : bool Flag indicating whether to

static RegressionResults.llf()

statsmodels.regression.linear_model.RegressionResults.llf static RegressionResults.llf()

static IVRegressionResults.rsquared()

statsmodels.sandbox.regression.gmm.IVRegressionResults.rsquared static IVRegressionResults.rsquared()