Stata 15 help for oneway

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

Syntax

oneway response_var factor_var [if] [in] [weight] [, options]

options Description ------------------------------------------------------------------------- Main bonferroni Bonferroni multiple-comparison test scheffe Scheffe multiple-comparison test sidak Sidak multiple-comparison test tabulate produce summary table [no]means include or suppress means; default is means [no]standard include or suppress standard deviations; default is standard [no]freq include or suppress frequencies; default is freq [no]obs include or suppress number of obs; default is obs if data are weighted noanova suppress the ANOVA table nolabel show numeric codes, not labels wrap do not break wide tables missing treat missing values as categories ------------------------------------------------------------------------- by is allowed; see [D] by. aweights and fweights 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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index