Main Content

Hypothesis Tests

t-test, F-test, chi-square goodness-of-fit test, and more

Statistics and Machine Learning Toolbox™ provides parametric and nonparametric hypothesis tests to help you determine if your sample data comes from a population with particular characteristics.

Distribution tests, such as Anderson-Darling and one-sample Kolmogorov-Smirnov, test whether sample data comes from a population with a particular distribution. Test whether two sets of sample data have the same distribution using tests such as two-sample Kolmogorov-Smirnov.

Location tests, such as z-test and one-sample t-test, test whether sample data comes from a population with a particular mean or median. Test two or more sets of sample data for the same location value using a two-sample t-test or multiple comparison test.

Dispersion tests, such as Chi-square variance, test whether sample data comes from a population with a particular variance. Compare the variances of two or more sample data sets using a two-sample F-test or multiple-sample test.

Determine additional features of sample data by cross-tabulating, conducting a run test for randomness, and determine the sample size and power for a hypothesis test.

Functions

expand all

adtestAnderson-Darling test
chi2gofChi-square goodness-of-fit test
crosstabCross-tabulation
dwtestDurbin-Watson test with residual inputs
fishertestFisher’s exact test
jbtestJarque-Bera test
kstestOne-sample Kolmogorov-Smirnov test
kstest2Two-sample Kolmogorov-Smirnov test
lillietestLilliefors test
mmdtestTwo-sample multivariate hypothesis test using maximum mean discrepancy (MMD) (Since R2024b)
runstestRun test for randomness
friedmanFriedman’s test
kruskalwallisKruskal-Wallis test
multcompareMultiple comparison test
ranksumWilcoxon rank sum test
sampsizepwrSample size and power of test
signrankWilcoxon signed rank test
signtestSign test
ttestOne-sample and paired-sample t-test
ttest2Two-sample t-test
ztestz-test
ansaribradleyAnsari-Bradley test
barttestBartlett’s test
sampsizepwrSample size and power of test
vartestChi-square variance test
vartest2Two-sample F-test for equal variances
vartestn Multiple-sample tests for equal variances
meanEffectSizeOne-sample or two-sample effect size computations (Since R2022a)
gardnerAltmanPlotGardner-Altman plot for two-sample effect size (Since R2022a)

Detect Drift

detectdriftDetect drifts between baseline and target data using permutation testing (Since R2022a)

Access Test Results

DriftDiagnosticsDiagnostics information for batch drift detection (Since R2022a)

Examine Test Results

summarySummary table for DriftDiagnostics object (Since R2022a)
ecdfCompute empirical cumulative distribution function (ecdf) for baseline and target data specified for data drift detection (Since R2022a)
histcountsCompute histogram bin counts for specified variables in baseline and target data for drift detection (Since R2022a)
plotDriftStatusPlot p-values and confidence intervals for variables tested for data drift (Since R2022a)
plotEmpiricalCDFPlot empirical cumulative distribution function (ecdf) of a variable specified for data drift detection (Since R2022a)
plotHistogramPlot histogram of a variable specified for data drift detection (Since R2022a)
plotPermutationResultsPlot histogram of permutation results for a variable specified for data drift detection (Since R2022a)

Topics

Featured Examples