anova(deprecated)/oneway - Help

stats[anova]

 oneway
 analysis of variance, one way

 Calling Sequence anova[oneway](data)

Parameters

 data - list of list of statistical data

Description

 • Important: The stats package has been deprecated. Use the superseding command Statistics[OneWayANOVA] instead.
 • Suppose that one performs experiments varying only one factor. For each value of the factor, one repeats the experiment many times. Such experiments are known both as one-way classifications and as one-factor experiments.
 • The anova[oneway] command is used to test whether changing the factor has any significant influence, or whether the apparent change could have just as well been due to random fluctuations. Each value of the factor gives rise to one treatment. Each treatment is repeated (or replicated) and the results are put in a list. The data required by anova[oneway] is then a list of all those lists.
 • The anova[oneway] command allows each treatment to have different number of replications.
 • The result of anova[oneway] comprises two elements: the variance part and the variance ratio parts. The presentation models the usual analysis of variance tables and the elements are presented in a way that is similar between oneway, twoway, and twowayreplicated.
 • For oneway, the variance part is further subdivided into three subparts: the variance between treatments, the variance within treatments and the total variance. Each of those are lists of three elements (two for total variance): the degree of freedom associated to this element, the variation in this element and the mean square of this element (mean square is not used for the total variance).
 • For oneway, the variance ratio part has only one ratio. It has four components: two degrees of freedom, the ratio and the probability value. This ratio follows an F-ratio statistic with the two given degrees of freedom. It allows us to test the null hypothesis (that the means of each treatment are equal) using a one-tailed test of the F-ratio distribution.

Examples

Important: The stats package has been deprecated. Use the superseding command Statistics[OneWayANOVA] instead.

 > $\mathrm{with}\left({\mathrm{stats}}_{\mathrm{anova}}\right):$
 > $\mathrm{with}\left({\mathrm{stats}}_{\mathrm{describe}}\right):$
 > $\mathrm{Treatment_1}≔\left[10,11,8\right]$
 ${\mathrm{Treatment_1}}{:=}\left[{10}{,}{11}{,}{8}\right]$ (1)

Three  of the measures have the same value

 > $\mathrm{Treatment_2}≔\left[\mathrm{Weight}\left(9,3\right),11\right]$
 ${\mathrm{Treatment_2}}{:=}\left[{\mathrm{Weight}}{}\left({9}{,}{3}\right){,}{11}\right]$ (2)

 > $\mathrm{Treatment_3}≔\left[\mathrm{missing},10,11,7,12\right]$
 ${\mathrm{Treatment_3}}{:=}\left[{\mathrm{missing}}{,}{10}{,}{11}{,}{7}{,}{12}\right]$ (3)
 > $\mathrm{data}≔\left[\mathrm{Treatment_1},\mathrm{Treatment_2},\mathrm{Treatment_3}\right]$
 ${\mathrm{data}}{:=}\left[\left[{10}{,}{11}{,}{8}\right]{,}\left[{\mathrm{Weight}}{}\left({9}{,}{3}\right){,}{11}\right]{,}\left[{\mathrm{missing}}{,}{10}{,}{11}{,}{7}{,}{12}\right]\right]$ (4)
 > $R≔\mathrm{oneway}\left(\mathrm{data}\right)$
 ${R}{:=}\left[\left[{2}{,}\frac{{17}}{{33}}{,}\frac{{17}}{{66}}\right]{,}\left[{8}{,}\frac{{65}}{{3}}{,}\frac{{65}}{{24}}\right]{,}\left[{10}{,}\frac{{244}}{{11}}\right]\right]{,}\left[{2}{,}{8}{,}\frac{{68}}{{715}}{,}{0.089709850848}\right]$ (5)

The F-ratio is 68/715 with 2 and 8 degrees of freedom.

 > $\mathrm{Ratio}≔{2}_{}$
 ${\mathrm{Ratio}}{:=}\left[{2}{,}{8}{,}\frac{{68}}{{715}}{,}{0.089709850848}\right]$ (6)

the level of significance is measured with

 > $\mathrm{sig}≔\mathrm{stats}[\mathrm{statevalf},\mathrm{cdf},\mathrm{fratio}[\mathrm{Ratio}[1],\mathrm{Ratio}[2]]]\left({\mathrm{Ratio}}_{3}\right)$
 ${\mathrm{sig}}{:=}{0.08970985085}$ (7)

Since this is much smaller than 0.95, we conclude that there is no significance to the differences in means:

 > $\mathrm{map}\left(\mathrm{mean},\left[\mathrm{Treatment_1},\mathrm{Treatment_2},\mathrm{Treatment_3}\right]\right)$
 $\left[\frac{{29}}{{3}}{,}\frac{{19}}{{2}}{,}{10}\right]$ (8)
 > $\mathrm{evalf}\left(\right)$
 $\left[{9.666666667}{,}{9.500000000}{,}{10.}\right]$ (9)

Now we change the treatment results to yield

 > $\mathrm{data2}≔\left[\left[10,11,8\right],\left[\mathrm{Weight}\left(11,3\right),13\right],\left[\mathrm{missing},14,15,11,16\right]\right]:$
 > $\mathrm{Ratio2}≔{\mathrm{oneway}\left(\mathrm{data2}\right)}_{2}$
 ${\mathrm{Ratio2}}{:=}\left[{2}{,}{8}{,}\frac{{4388}}{{715}}{,}{0.97575671908}\right]$ (10)

The difference between

 > $\mathrm{map}\left(\mathrm{mean},\mathrm{data2}\right)$
 $\left[\frac{{29}}{{3}}{,}\frac{{23}}{{2}}{,}{14}\right]$ (11)
 > $\mathrm{evalf}\left(\right)$
 $\left[{9.666666667}{,}{11.50000000}{,}{14.}\right]$ (12)

is significant at the 0.05 level (since 0.976>0.95) but not at the 0.01 level (since 0.976<0.99).