NegativeBinomial.deriv()

statsmodels.genmod.families.links.NegativeBinomial.deriv NegativeBinomial.deriv(p) [source] Derivative of the negative binomial transform Parameters: p : array-like Mean parameters Returns: g?(p) : array The derivative of the negative binomial transform link function Notes g?(x) = 1/(x+alpha*x^2)

NegativeBinomialResults.summary()

statsmodels.discrete.discrete_model.NegativeBinomialResults.summary NegativeBinomialResults.summary(yname=None, xname=None, title=None, alpha=0.05, yname_list=None) Summarize the Regression Results Parameters: yname : string, optional Default is y xname : list of strings, optional Default is var_## for ## in p the number of regressors title : string, optional Title for the top table. If not None, then this replaces the default title alpha : float significance level for the confidence

static DescrStatsW.sumsquares()

statsmodels.stats.weightstats.DescrStatsW.sumsquares static DescrStatsW.sumsquares() [source] weighted sum of squares of demeaned data

PHRegResults.predict()

statsmodels.duration.hazard_regression.PHRegResults.predict PHRegResults.predict(endog=None, exog=None, strata=None, offset=None, pred_type='lhr') [source] Returns predicted values from the fitted proportional hazards regression model. Parameters: params : array-;like The proportional hazards model parameters. endog : array-like Duration (time) values at which the predictions are made. Only used if pred_type is either ?cumhaz? or ?surv?. If using model exog, defaults to model endog (time

graphics.functional.rainbowplot()

statsmodels.graphics.functional.rainbowplot statsmodels.graphics.functional.rainbowplot(data, xdata=None, depth=None, method='MBD', ax=None, cmap=None) [source] Create a rainbow plot for a set of curves. A rainbow plot contains line plots of all curves in the dataset, colored in order of functional depth. The median curve is shown in black. Parameters: data : sequence of ndarrays or 2-D ndarray The vectors of functions to create a functional boxplot from. If a sequence of 1-D arrays, these

InverseGaussian.predict()

statsmodels.genmod.families.family.InverseGaussian.predict InverseGaussian.predict(mu) Linear predictors based on given mu values. Parameters: mu : array The mean response variables Returns: lin_pred : array Linear predictors based on the mean response variables. The value of the link function at the given mu.

DescrStatsW.var_ddof()

statsmodels.stats.weightstats.DescrStatsW.var_ddof DescrStatsW.var_ddof(ddof=0) [source] variance of data given ddof Parameters: ddof : int, float degrees of freedom correction, independent of attribute ddof Returns: var : float, ndarray variance with denominator sum_weights - ddof

Models for Survival and Duration Analysis

Models for Survival and Duration Analysis Examples import statsmodels.api as sm import statsmodels.formula.api as smf data = sm.datasets.get_rdataset("flchain", "survival").data del data["chapter"] data = data.dropna() data["lam"] = data["lambda"] data["female"] = (data["sex"] == "F").astype(int) data["year"] = data["sample.yr"] - min(data["sample.yr"]) status = data["death"].values mod = smf.phreg("futime ~ 0 + age + female + creatinine + " "np.sqrt(kappa) + np.sqrt(lam) + y

Gamma.predict()

statsmodels.genmod.families.family.Gamma.predict Gamma.predict(mu) Linear predictors based on given mu values. Parameters: mu : array The mean response variables Returns: lin_pred : array Linear predictors based on the mean response variables. The value of the link function at the given mu.

IV2SLS.predict()

statsmodels.sandbox.regression.gmm.IV2SLS.predict IV2SLS.predict(params, exog=None) [source] Return linear predicted values from a design matrix. Parameters: exog : array-like Design / exogenous data params : array-like, optional after fit has been called Parameters of a linear model Returns: An array of fitted values : Notes If the model as not yet been fit, params is not optional.