Main Content




方差分析 (ANOVA) 是指将样本方差指定给不同的源,然后确定变异产生于不同总体组内还是组间的过程。样本用组均值的变异和总体均值的变异来描述。如果组内的变异相对于组间的变异较小,则可以推断出组均值的差异。假设检验用于量化决策。Statistics and Machine Learning Toolbox™ 提供几种执行 ANOVA 的方式,包括 anova 对象、命令行函数和交互式 App。



anovaAnalysis of variance (ANOVA) results (自 R2022b 起)
boxchartBox chart (box plot) for analysis of variance (ANOVA) (自 R2022b 起)
groupmeansMean response estimates for analysis of variance (ANOVA) (自 R2022b 起)
multcompareMultiple comparison of means for analysis of variance (ANOVA) (自 R2022b 起)
plotComparisonsInteractive plot of multiple comparisons of means for analysis of variance (ANOVA) (自 R2022b 起)
statsAnalysis of variance (ANOVA) table (自 R2022b 起)
varianceComponentVariance component estimates for analysis of variance (ANOVA) (自 R2022b 起)
anova1One-way analysis of variance
anova2Two-way analysis of variance
anovanN-way analysis of variance
canoncorrCanonical correlation
dummyvarCreate dummy variables
friedmanFriedman’s test
kruskalwallisKruskal-Wallis test
multcompareMultiple comparison test
aoctoolInteractive analysis of covariance


  • One-Way ANOVA

    Use one-way ANOVA to determine whether data from several groups (levels) of a single factor have a common mean.

  • Two-Way ANOVA

    In two-way ANOVA, the effects of two factors on a response variable are of interest.

  • N-Way ANOVA

    In N-way ANOVA, the effects of N factors on a response variable are of interest.

  • ANOVA with Random Effects

    ANOVA with random effects is used where a factor's levels represent a random selection from a larger (infinite) set of possible levels.

  • Other ANOVA Models

    N-way ANOVA can also be used when factors are nested, or when some factors are to be treated as continuous variables.

  • Multiple Comparisons

    Multiple comparison procedures can accurately determine the significance of differences between multiple group means.

  • Analysis of Covariance

    Analysis of covariance is a technique for analyzing grouped data having a response (y, the variable to be predicted) and a predictor (x, the variable used to do the prediction).

  • Nonparametric Methods

    Statistics and Machine Learning Toolbox functions include nonparametric versions of one-way and two-way analysis of variance.