📄 anova.hlp
字号:
{smcl}
{* 15feb2005}{...}
{cmd:help anova} {right:dialog: {bf:{dialog anova}}{space 15}}
{right:also see: {help anova postestimation}}
{hline}
{title:Title}
{p2colset 5 18 20 2}{...}
{p2col:{hi:[R] anova} {hline 2}}Analysis of variance and covariance
{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 14 2}
{cmdab:an:ova}
{varname}
[{it:term} [{cmd:/}] [{it:term} [{cmd:/}] {it:...}]]
{ifin}
{weight}
[{cmd:,} {it:options}]
{p 8 14 2}
where {it:term} is of the form {space 2}{it:varname}[{c -(}{cmd:*}|{cmd:|}{c )-}{it:varname}[{it:...}]]
{synoptset 23 tabbed}
{synopthdr}
{synoptline}
{syntab:Model}
{synopt:{opth ca:tegory(varlist)}}variables in {it:terms} that are categorical or
class{p_end}
{synopt:{opth cl:ass(varlist)}}synonym for
{cmd:category(}{it:varlist}{cmd:)}{p_end}
{synopt:{opth cont:inuous(varlist)}}variables in {it:terms} that are
continuous{p_end}
{synopt:{opth rep:eated(varlist)}}variables in {it:terms} that are
repeated-measures variables{p_end}
{synopt:{opt p:artial}}use partial (or marginal) sums of squares{p_end}
{synopt:{opt se:quential}}use sequential sums of squares{p_end}
{synopt:{opt nocons:tant}}suppress constant term{p_end}
{syntab:Adv. model}
{synopt:{opt bse(term)}}between-subjects error term in repeated-measures
ANOVA{p_end}
{synopt:{opth bseunit(varname)}}variable representing lowest unit in the
between-subjects error term{p_end}
{synopt:{opth group:ing(varname)}}grouping variable for computing pooled
covariance matrix{p_end}
{syntab:Reporting}
{synopt:{opt r:egress}}display the regression table{p_end}
{synopt:[{cmdab:no:}]{opt an:ova}}display or suppress the ANOVA table{p_end}
{synopt:{opt d:etail}}show mapping from values to level numbers for
categorical variables{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
{opt by} and {opt xi} are allowed; see {helpb prefix}.
{p_end}
{p 4 6 2}
{opt aweight}s and {opt fweight}s are allowed; see {help weight}.
{p_end}
{p 4 6 2}
See {help anova postestimation} for features available after estimation.
{p_end}
{title:Description}
{pstd}
The {opt anova} command fits analysis-of-variance (ANOVA) and
analysis-of-covariance (ANCOVA) models for balanced and unbalanced designs,
including designs with missing cells; for repeated-measures ANOVA; and for
factorial, nested, or mixed designs. {opt anova} can also be used to produce
regression estimates by those who have no interest in ANOVA and ANCOVA
output.
{pstd}
If you want to fit one-way ANOVA models, you may find the {opt oneway} or
{opt loneway} commands more convenient; see {helpb oneway} and
{helpb loneway}. If you are interested in MANOVA or MANCOVA, see
{helpb manova}.
{title:Options}
{dlgtab:Model}
{phang}
{opth category(varlist)} indicates the names of the variables
in the {it:terms} that are categorical or class variables. Stata ordinarily
assumes that all variables are categorical variables, so, in most cases, this
option need not be specified. If you specify this option, however, the
variables referenced in the {it:terms} that are not listed in
{cmd:category()} are assumed to be continuous. Also see the {cmd:class()} and
{cmd:continuous()} options.
{phang}
{opth class(varlist)} is a synonym for {opt category(varlist)}.
{phang}
{opth continuous(varlist)} indicates the names of the
variables in the {it:terms} that are continuous. Stata ordinarily assumes that
all variables are categorical variables. Also see the {cmd:category()} and
{cmd:class()} options.
{phang}
{opth repeated(varlist)} indicates the names of the
categorical variables in the {it:terms} that are to be treated as
repeated-measures variables in a repeated-measures ANOVA or ANCOVA.
{phang}
{opt partial} presents the ANOVA table using partial (or marginal) sums
of squares. This is the default. Also see the {opt sequential} option.
{phang}
{opt sequential} presents the ANOVA table using sequential sums of squares.
{phang}
{opt noconstant} suppresses the constant term (intercept) from the ANOVA
or regression model.
{dlgtab:Adv. model}
{phang}
{opt bse(term)} indicates the between-subjects error term in
a repeated-measures ANOVA. This option is needed only in the rare case when
the {opt anova} command cannot automatically determine the between-subjects
error term.
{phang}
{opth bseunit(varname)} indicates the variable representing
the lowest unit in the between-subjects error term in a repeated-measures
ANOVA. This option is rarely needed since the {opt anova} command
automatically selects the first variable listed in the between-subjects error
term as the default for this option.
{phang}
{opth grouping(varname)} indicates a variable that determines which
observations are grouped together in computing the covariance matrices that
will be pooled together and used in a repeated-measures ANOVA. This option is
rarely needed since the {opt anova} command automatically selects the
combination of all variables except the first (or as specified in the
{opt bseunit()} option) in the between-subjects error term as the default for
grouping observations.
{dlgtab:Reporting}
{phang}
{opt regress} presents the regression output corresponding to the specified
model. Specifying {opt regress} implies the {opt noanova} option, so if you
want both the regression output and ANOVA table, you must also specify the
{opt anova} option. You need not specify the {opt regress} option at the time
of estimation. You can obtain the underlying regression estimates at any time
by typing {cmd:anova, regress}.
{phang}
[{opt no}]{opt anova} indicates that the ANOVA table be or not be
displayed. The {opt anova} command typically displays the ANOVA table, and in
those cases, the {opt noanova} option suppresses the display. For instance,
typing {cmd:anova, detail noanova} would show the {opt detail} output
for the last ANOVA model while suppressing the ANOVA table itself.
{pmore}
If you specify the {opt regress} option, the ANOVA table is automatically
suppressed. In that case, also specifying the {opt anova} option would show
both the regression output and the ANOVA table.
{phang}
{opt detail} presents a table showing the actual values of the
categorical variables along with their mapping into level numbers. You do not
have to specify this option at the time of estimation. You can obtain the
output at any time by typing {cmd:anova, detail}.
{title:Examples}
{cmd:. anova y a}
{cmd:. anova y a b}
{cmd:. anova y a b a*b}
{cmd:. anova y a b c}
{p 4 8 2}{cmd:. anova y a b c a*b a*c b*c}{p_end}
{p 4 8 2}{cmd:. anova y a b c a*b a*c b*c a*b*c}
{title:ANCOVA examples}
{p 4 8 2}{cmd:. anova y a b x, continuous(x)}{p_end}
{p 4 8 2}{cmd:. anova y a b x z, continuous(x z)}{p_end}
{p 4 8 2}{cmd:. anova y a b x a*x a*x*x, continuous(x)}{p_end}
{p 4 8 2}{cmd:. anova y a b a*b x a*x z a*z, continuous(x z)}
{title:Nested ANOVA examples}
{p 4 8 2}{cmd:. anova output machine / operator|machine /}{p_end}
{p 4 8 2}{cmd:. anova response t / c|t / d|c|t / p|d|c|t /}
{title:Split-plot ANOVA example}
{p 4 8 2}{cmd:. anova y pr / cl|pr sk pr*sk / cl*sk|pr / gr|cl*sk|pr /}
{title:Repeated measures ANOVA examples}
{p 4 8 2}{cmd:. anova score person drug, repeated(drug)}{p_end}
{p 4 8 2}{cmd:. anova y sub / rep|sub region / region*sub / , repeated(region)}{p_end}
{p 4 8 2}{cmd:. anova y cal / sub|cal shape cal*shape , repeated(shape)}{p_end}
{p 4 8 2}{cmd:. anova y n / sub|n p n*p / p*sub|n d n*d / d*sub|n p*d n*p*d, rep(p d)}
{title:Also see}
{psee}
Manual: {bf:[R] anova}
{psee}
Online: {help anova_postestimation};{break}
{helpb encode},
{helpb reshape},
{helpb loneway},
{helpb oneway},
{helpb regress},
{helpb manova}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -