iolib.smpickle.save_pickle()

statsmodels.iolib.smpickle.save_pickle statsmodels.iolib.smpickle.save_pickle(obj, fname) [source] Save the object to file via pickling. Parameters: fname : str Filename to pickle to

iolib.smpickle.load_pickle()

statsmodels.iolib.smpickle.load_pickle statsmodels.iolib.smpickle.load_pickle(fname) [source] Load a previously saved object from file Parameters: fname : str Filename to unpickle Notes This method can be used to load both models and results.

iolib.foreign.StataWriter()

statsmodels.iolib.foreign.StataWriter class statsmodels.iolib.foreign.StataWriter(fname, data, convert_dates=None, encoding='latin-1', byteorder=None) [source] A class for writing Stata binary dta files from array-like objects Parameters: fname : file path or buffer Where to save the dta file. data : array-like Array-like input to save. Pandas objects are also accepted. convert_dates : dict Dictionary mapping column of datetime types to the stata internal format that you want to use fo

iolib.foreign.StataReader()

statsmodels.iolib.foreign.StataReader class statsmodels.iolib.foreign.StataReader(fname, missing_values=False, encoding=None) [source] Stata .dta file reader. Provides methods to return the metadata of a Stata .dta file and a generator for the data itself. Parameters: file : file-like A file-like object representing a Stata .dta file. missing_values : bool If missing_values is True, parse missing_values and return a Missing Values object instead of None. encoding : string, optional Use

iolib.foreign.savetxt()

statsmodels.iolib.foreign.savetxt statsmodels.iolib.foreign.savetxt(fname, X, names=None, fmt='%.18e', delimiter=' ') [source] Save an array to a text file. This is just a copy of numpy.savetxt patched to support structured arrays or a header of names. Does not include py3 support now in savetxt. Parameters: fname : filename or file handle If the filename ends in .gz, the file is automatically saved in compressed gzip format. loadtxt understands gzipped files transparently. X : array_like

iolib.foreign.genfromdta()

statsmodels.iolib.foreign.genfromdta statsmodels.iolib.foreign.genfromdta(fname, missing_flt=-999.0, encoding=None, pandas=False, convert_dates=True) [source] Returns an ndarray or DataFrame from a Stata .dta file. Parameters: fname : str or filehandle Stata .dta file. missing_flt : numeric The numeric value to replace missing values with. Will be used for any numeric value. encoding : string, optional Used for Python 3 only. Encoding to use when reading the .dta file. Defaults to loca

inverse_squared.inverse_deriv()

statsmodels.genmod.families.links.inverse_squared.inverse_deriv inverse_squared.inverse_deriv(z) Derivative of the inverse of the power transform Parameters: z : array-like z is usually the linear predictor for a GLM or GEE model. Returns: The value of the derivative of the inverse of the power transform : function :

inverse_squared.inverse()

statsmodels.genmod.families.links.inverse_squared.inverse inverse_squared.inverse(z) Inverse of the power transform link function Parameters: `z` : array-like Value of the transformed mean parameters at p Returns: `p` : array Mean parameters Notes g^(-1)(z`) = z`**(1/`power)

inverse_squared.deriv2()

statsmodels.genmod.families.links.inverse_squared.deriv2 inverse_squared.deriv2(p) Second derivative of the link function g??(p) implemented through numerical differentiation

inverse_squared.deriv()

statsmodels.genmod.families.links.inverse_squared.deriv inverse_squared.deriv(p) Derivative of the power transform Parameters: p : array-like Mean parameters Returns: g?(p) : array Derivative of power transform of p Notes g?(p) = power * p`**(`power - 1)