**[R] oneway** -- One-way analysis of variance

__Syntax__

__on__**eway** *response_var* *factor_var* [*if*] [*in*] [*weight*] [**,** *options*]

*options* Description
-------------------------------------------------------------------------
Main
__b__**onferroni** Bonferroni multiple-comparison test
__sc__**heffe** Scheffe multiple-comparison test
__si__**dak** Sidak multiple-comparison test
__t__**abulate** produce summary table
[__no__]__me__**ans** include or suppress means; default is **means**
[__no__]__st__**andard** include or suppress standard deviations; default is
**standard**
[__no__]__f__**req** include or suppress frequencies; default is **freq**
[__no__]__o__**bs** include or suppress number of obs; default is **obs** if
data are weighted
__noa__**nova** suppress the ANOVA table
__nol__**abel** show numeric codes, not labels
__w__**rap** do not break wide tables
__mi__**ssing** treat missing values as categories
-------------------------------------------------------------------------
**by** is allowed; see **[D] by**.
**aweight**s and **fweight**s are allowed; see weight.

__Menu__

**Statistics > Linear models and related > ANOVA/MANOVA > One-way ANOVA**

__Description__

The **oneway** command reports one-way analysis-of-variance (ANOVA) models
and performs multiple-comparison tests.

If you wish to fit more complicated ANOVA layouts or wish to fit
analysis-of-covariance (ANOCOVA) models, see **[R] anova**.

See **[D] encode** for examples of fitting ANOVA models on string variables.

See **[R] loneway** for an alternative **oneway** command with slightly different
features.

__Options__

+------+
----+ Main +-------------------------------------------------------------

**bonferroni** reports the results of a Bonferroni multiple-comparison test.

**scheffe** reports the results of a Scheffe multiple-comparison test.

**sidak** reports the results of a Sidak multiple-comparison test.

**tabulate** produces a table of summary statistics of the *response_var* by
levels of the *factor_var*. The table includes the mean, standard
deviation, frequency, and, if the data are weighted, the number of
observations. Individual elements of the table may be included or
suppressed by using the [**no**]**means**, [**no**]**standard**, [**no**]**freq**, and
[**no**]**obs** options. For example, typing

**oneway response factor, tabulate means standard**

produces a summary table that contains only the means and standard
deviations. You could achieve the same result by typing

**oneway response factor, tabulate nofreq**

[**no**]**means** includes or suppresses only the means from the table produced
by the **tabulate** option. See **tabulate** above.

[**no**]**standard** includes or suppresses only the standard deviation from the
table produced by the **tabulate** option. See **tabulate** above.

[**no**]**freq** includes or suppresses only the frequencies from the table
produced by the **tabulate** option. See **tabulate** above.

[**no**]**obs** includes or suppresses only the reported number of observations
from the table produced by the **tabulate** option. If the data are not
weighted, only the frequency is reported. If the data are weighted,
the frequency refers to the sum of the weights. See **tabulate** above.

**noanova** suppresses the display of the ANOVA table.

**nolabel** causes the numeric codes to be displayed rather than the value
labels in the ANOVA and multiple-comparison test tables.

**wrap** requests that Stata not break up wide tables to make them more
readable.

**missing** requests that missing values of *factor_var* be treated as a
category rather than as observations to be omitted from the analysis.

__Examples__

---------------------------------------------------------------------------
Setup
**. webuse apple**
**. oneway weight treatment**

Obtaining observed means
**. oneway weight treatment, tabulate**

Bonferroni multiple-comparison test
**. oneway weight treatment, bonferroni**

Scheffe multiple-comparison test
**. oneway weight treatment, scheffe**

---------------------------------------------------------------------------
Setup
**. webuse census8**

With weighted data
**. oneway drate region [w=pop]**
---------------------------------------------------------------------------

__Video example__

One-way ANOVA in Stata

__Stored results__

**oneway** stores the following in **r()**:

Scalars
**r(N)** number of observations
**r(F)** F statistic
**r(df_r)** within-group degrees of freedom
**r(mss)** between-group sum of squares
**r(df_m)** between-group degrees of freedom
**r(rss)** within-group sum of squares
**r(chi2bart)** Bartlett's chi-squared
**r(df_bart)** Bartlett's degrees of freedom