3.11.1. statsmodels.stats.api

3.11.1.1. Functions

acorr_breush_godfrey(results[, nlags, store]) Breush Godfrey Lagrange Multiplier tests for residual autocorrelation
acorr_ljungbox(x[, lags, boxpierce]) Ljung-Box test for no autocorrelation
anova_lm(*args, **kwargs) ANOVA table for one or more fitted linear models.
binom_test(count, nobs[, prop, alternative]) Perform a test that the probability of success is p.
binom_test_reject_interval(value, nobs[, ...]) rejection region for binomial test for one sample proportion
binom_tost(count, nobs, low, upp) exact TOST test for one proportion using binomial distribution
binom_tost_reject_interval(low, upp, nobs[, ...]) rejection region for binomial TOST
breaks_cusumolsresid(olsresidual[, ddof]) cusum test for parameter stability based on ols residuals
breaks_hansen(olsresults) test for model stability, breaks in parameters for ols, Hansen 1992
chisquare_effectsize(probs0, probs1[, ...]) effect size for a chisquare goodness-of-fit test
cochrans_q(x) Cochran’s Q test for identical effect of k treatments
corr_clipped(corr[, threshold]) Find a near correlation matrix that is positive semi-definite
corr_nearest(corr[, threshold, n_fact]) Find the nearest correlation matrix that is positive semi-definite.
cov_cluster(results, group[, use_correction]) cluster robust covariance matrix
cov_cluster_2groups(results, group[, ...]) cluster robust covariance matrix for two groups/clusters
cov_hac(results[, nlags, weights_func, ...]) heteroscedasticity and autocorrelation robust covariance matrix (Newey-West)
cov_hc0(results) See statsmodels.RegressionResults
cov_hc1(results) See statsmodels.RegressionResults
cov_hc2(results) See statsmodels.RegressionResults
cov_hc3(results) See statsmodels.RegressionResults
cov_nearest(cov[, method, threshold, ...]) Find the nearest covariance matrix that is postive (semi-) definite
cov_nw_panel(results, nlags, groupidx[, ...]) Panel HAC robust covariance matrix
cov_white_simple(results[, use_correction]) heteroscedasticity robust covariance matrix (White)
durbin_watson(resids[, axis]) Calculates the Durbin-Watson statistic
fdrcorrection(pvals[, alpha, method, is_sorted]) pvalue correction for false discovery rate
fdrcorrection_twostage(pvals[, alpha, ...]) (iterated) two stage linear step-up procedure with estimation of number of true
gof_chisquare_discrete(distfn, arg, rvs, ...) perform chisquare test for random sample of a discrete distribution
het_arch(resid[, maxlag, autolag, store, ...]) Engle’s Test for Autoregressive Conditional Heteroscedasticity (ARCH)
het_breushpagan(resid, exog_het) Breush-Pagan Lagrange Multiplier test for heteroscedasticity
het_white(resid, exog[, retres]) White’s Lagrange Multiplier Test for Heteroscedasticity
jarque_bera(resids[, axis]) Calculate residual skewness, kurtosis, and do the JB test for normality
lillifors(x[, pvalmethod]) Lillifors test for normality,
linear_harvey_collier(res) Harvey Collier test for linearity
linear_lm(resid, exog[, func]) Lagrange multiplier test for linearity against functional alternative
linear_rainbow(res[, frac]) Rainbow test for linearity
mcnemar(x[, y, exact, correction]) McNemar test
multipletests(pvals[, alpha, method, ...]) test results and p-value correction for multiple tests
normal_ad(x[, axis]) Anderson-Darling test for normal distribution unknown mean and variance
omni_normtest(resids[, axis]) Omnibus test for normality
power_binom_tost(low, upp, nobs[, p_alt, alpha])
power_ztost_prop(low, upp, nobs, p_alt[, ...]) Power of proportions equivalence test based on normal distribution
powerdiscrepancy(observed, expected[, ...]) Calculates power discrepancy, a class of goodness-of-fit tests as a measure of discrepancy between observed and expected data.
proportion_confint(count, nobs[, alpha, method]) confidence interval for a binomial proportion
proportion_effectsize(prop1, prop2[, method]) effect size for a test comparing two proportions
proportions_chisquare(count, nobs[, value]) test for proportions based on chisquare test
proportions_chisquare_allpairs(count, nobs) chisquare test of proportions for all pairs of k samples
proportions_chisquare_pairscontrol(count, nobs) chisquare test of proportions for pairs of k samples compared to control
proportions_ztest(count, nobs[, value, ...]) test for proportions based on normal (z) test
proportions_ztost(count, nobs, low, upp[, ...]) Equivalence test based on normal distribution
recursive_olsresiduals(olsresults[, skip, ...]) calculate recursive ols with residuals and cusum test statistic
runstest_1samp(x[, cutoff, correction]) use runs test on binary discretized data above/below cutoff
runstest_2samp(x[, y, groups, correction]) Wald-Wolfowitz runstest for two samples
se_cov(cov) get standard deviation from covariance matrix
symmetry_bowker(table) Test for symmetry of a (k, k) square contingency table
ttest_ind(x1, x2[, alternative, usevar, ...]) ttest independent sample
ttost_ind(x1, x2, low, upp[, usevar, ...]) test of (non-)equivalence for two independent samples
ttost_paired(x1, x2, low, upp[, transform, ...]) test of (non-)equivalence for two dependent, paired sample
tukeyhsd(mean_all, nobs_all, var_all[, df, ...]) simultaneous Tukey HSD
unitroot_adf(x[, maxlag, trendorder, ...])
zconfint(x1[, x2, value, alpha, ...]) confidence interval based on normal distribution z-test
ztest(x1[, x2, value, alternative, usevar, ddof]) test for mean based on normal distribution, one or two samples
ztost(x1, low, upp[, x2, usevar, ddof]) Equivalence test based on normal distribution

3.11.1.2. Classes

CompareCox Cox Test for non-nested models
CompareJ J-Test for comparing non-nested models
CompareMeans(d1, d2) class for two sample comparison
DescrStatsW(data[, weights, ddof]) descriptive statistics and tests with weights for case weights
Describe(dataset) Calculates descriptive statistics for data.
FTestAnovaPower(**kwds) Statistical Power calculations F-test for one factor balanced ANOVA
FTestPower(**kwds) Statistical Power calculations for generic F-test
GofChisquarePower(**kwds) Statistical Power calculations for one sample chisquare test
HetGoldfeldQuandt test whether variance is the same in 2 subsamples
NormalIndPower([ddof]) Statistical Power calculations for z-test for two independent samples.
Runs(x) class for runs in a binary sequence
TTestIndPower(**kwds) Statistical Power calculations for t-test for two independent sample
TTestPower(**kwds) Statistical Power calculations for one sample or paired sample t-test