📄 test.hlp
字号:
{smcl}
{* 18mar2005}{...}
{cmd:help test}, {cmd:help testparm}{right:dialogs: {bf:{dialog test}} {bf:{dialog testparm}}}
{hline}
{title:Title}
{p2colset 5 17 19 2}{...}
{p2col:{hi:[R] test} {hline 2}}Test linear hypotheses after estimation{p_end}
{p2colreset}{...}
{title:Syntax}
{synoptset 12}{...}
{synopt:Basic syntax}
(see {help anova_postestimation##testanova:anova postestimation} for {opt test}
after anova;{break}
see {help manova_postestimation##testmanova:manova postestimation} for {opt test}
after manova){p_end}
{p2colreset}{...}
{p 8 48 2}
{cmdab:te:st}
{it:{help test##coeflist:coeflist}}
{space 26}({help test##Syntax1:Syntax 1})
{p 8 48 2}
{cmdab:te:st}
{it:{help test##exp:exp}}{cmd:=}{it:exp}[{cmd:=}...]
{space 21}({help test##Syntax2:Syntax 2})
{p 8 48 2}
{cmdab:te:st}
{cmd:[}{it:{help test##eqno:eqno}}{cmd:]}
[{cmd::} {varlist}]
{space 16}({help test##Syntax3:Syntax 3})
{p 8 48 2}
{cmdab:te:st}
{cmd:[}{it:{help test##eqno:eqno}}{cmd:=}{it:eqno}[{cmd:=}...]{cmd:]}
[{cmd::} {varlist}]
{space 5}({help test##Syntax4:Syntax 4})
{p 8 17 2}
{cmd:testparm}
{varlist}
[{cmd:,}
{opt e:qual}
{opth eq:uation(test##eqno:eqno)}]
{pstd}
Full syntax
{p 8 14 2}
{cmdab:te:st}
{cmd:(}{it:{help test##spec:spec}}{cmd:)}
[{cmd:(}{it:spec}{cmd:)} ...]
[{cmd:,} {it:test_options}]
{synoptset 19 tabbed}{...}
{synopthdr:test_options}
{synoptline}
{syntab:Options}
{synopt:{opt m:test}[{opt (opt)}]}
test each condition separately
{p_end}
{synopt:{opt coef}}
report estimated constrained coefficients
{p_end}
{synopt:{opt a:ccumulate}}
test hypothesis jointly with previously tested hypotheses
{p_end}
{synopt:{opt not:est}}
suppress the output
{p_end}
{synopt:{opt common}}
test only variables common to all the equations
{p_end}
{synopt:{opt cons:tant}}
include the constant in coefficients to be tested
{p_end}
{synopt:{opt nosvy:adjust}}
carry out the Wald test as W/k ~ F(k,d); for use with
{opt svy} estimation commands
{p_end}
{synopt:{opt min:imum}}
perform test with the constant, drop terms until the test becomes nonsingular,
and test without the constant on the remaining terms; highly technical
{p_end}
{p2coldent:+ {opt matvlc(matname)}}
save the variance-covariance matrix; programmer's option
{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
+ {opt matvlc(matname)} does not appear in the dialog box.{p_end}
{p 4 6 2}
{it:varlist} and {it:varname} may contain time-series operators; see {help tsvarlist}.
{p_end}
{pin2}{marker Syntax1}
Syntax 1 tests that coefficients are 0.
{pin2}{marker Syntax2}
Syntax 2 tests that linear expressions are equal.
{pin2}{marker Syntax3}
Syntax 3 tests that coefficients in {it:eqno} are 0.
{pin2}{marker Syntax4}
Syntax 4 tests equality of coefficients between equations.
{marker spec}{...}
{p 8 8 2}{it:spec} is one of{p_end}
{p 12 16 2}{it:coeflist}{p_end}
{p 12 16 2}{it:exp}{cmd:=}{it:exp}[=...]}{p_end}
{p 12 16 2}{cmd:[}{it:eqno}{cmd:]}[{cmd::} {varlist}]{p_end}
{p 12 16 2}{cmd:[}{it:eqno1}{cmd:=}{it:eqno2}[{cmd:=}...]{cmd:]}[{cmd:: } {it:varlist}]{p_end}
{marker coeflist}{...}
{it:coeflist} is
{varlist}
{cmd:[}{it:eqno}{cmd:]}{varname} [{cmd:[}{it:eqno}{cmd:]}{it:varname}...]
{cmd:[}{it:eqno}{cmd:]_b[}{it:varname}{cmd:]} [{cmd:[}{it:eqno}{cmd:]_b[}{it:varname}{cmd:]}...]
{marker exp}{...}
{it:exp} is a linear expression containing
{varname}
{cmd:_b[}{it:varname}{cmd:]}
{cmd:[}{it:eqno}{cmd:]}{it:varname}
{cmd:[}{it:eqno}{cmd:]_b[}{it:varname}{cmd:]}
{marker eqno}{...}
{it:eqno} is
{cmd:#}{it:#}
{it:name}
{pstd}
Distinguish between {cmd:[]}, which are to be typed, and [], which indicate
optional arguments.
{pstd}
While not shown in the syntax diagram, parentheses around {it:spec} are
only required with multiple specifications. Also, the diagram does not show that
{opt test} may be called without arguments to redisplay the results
from the last {opt test}.
{title:Description}
{pstd}
{opt test} performs Wald tests for simple and composite linear hypotheses
about the parameters of the most recently fitted model.
{pstd}
{opt test} supports {helpb svy} estimators, carrying out an adjusted Wald test
by default in such cases.
{pstd}
{opt testparm} provides a useful alternative to {opt test} that permits
{varlist} rather than a list of coefficients (which is often nothing
more than a list of variables), allowing use of standard Stata notation,
including '{opt -}' and '{opt *}', which are given the expression
interpretation by {opt test}.
{pstd}
{opt test} and {opt testparm} perform Wald tests. For likelihood ratio tests,
see {helpb lrtest}.
For Wald-type tests of nonlinear hypotheses, see {helpb testnl}.
To display estimates for one-dimensional linear or nonlinear expressions of
coefficients, see {helpb lincom} and {helpb nlcom}.
{pstd}
See {help anova_postestimation##testanova:anova postestimation} for
{opt test} after {opt anova}.
{pstd}
See {help manova_postestimation##testmanova:manova postestimation} for
{opt test} after {opt manova}.
{title:Options for testparm}
{phang}
{opt equal} tests that the variables
appearing in {varlist}, which also appear in the previously fitted model,
are equal to each other rather than jointly equal to zero.
{phang}
{opth "equation(test##eqno:eqno)"}
is only relevant for multiple-equation models such as {helpb mvreg},
{helpb mlogit}, and {helpb heckman}. It specifies the equation for which the
all-zero or all-equal hypothesis is tested. {cmd:equation(#1)} specifies
that the test be conducted regarding the first equation {cmd:#1}.
{cmd:equation(price)} specifies that the test concern the equation named
{cmd:price}.
{title:Options for test}
{dlgtab:Options}
{phang}
{opt mtest}[{opt (opt)}]
specifies that tests be performed for each condition separately. {it:opt}
specifies the method for adjusting p-values for multiple testing. Valid
values for {it:opt} are
{pin3}{opt b:onferroni}{space 4}Bonferroni's method{p_end}
{pin3}{opt h:olm}{space 10}Holm's method{p_end}
{pin3}{opt s:idak}{space 9}Sidak's method{p_end}
{pin3}{opt noadj:ust}{space 6}no adjustment is to be made{p_end}
{pmore}
Specifying {opt mtest} without an argument is equivalent to
{cmd:mtest(noadjust)}. {opt mtest} is not allowed after {helpb "svy: mean"},
{helpb "svy: total"}, or {helpb "svy: ratio"}.
{phang}
{opt coef} specifies that the estimated constrained coefficients be displayed.
{phang}
{opt accumulate} allows a hypothesis to be tested jointly with the previously
tested hypotheses.
{phang}
{opt notest} suppresses the output. This option is useful when you are
interested only in the joint test of a number of hypotheses, specified in a
subsequent call of {cmd:test, accumulate}.
{phang}
{opt common} specifies that when you use the
{cmd:[}{it:eqno1}{cmd:=}{it:eqno2}[{cmd:=}...]{cmd:]} form of
{it:spec}, the variables common to the equations {it:eqno1}, {it:eqno2},
etc., be tested. The default action is to complain if the equations have
variables not in common.
{phang}
{opt constant} specifies that {opt _cons} be included in the list of
coefficients to be tested when using the
{cmd:[}{it:eqno1}{cmd:=}{it:eqno2}[{cmd:=}...]{cmd:]}
or {cmd:[}{it:eqno}{cmd:]} forms of {it:spec}. The default
is not to include {opt _cons}.
{phang}
{opt nosvyadjust}
is for use with {opt svy} estimation commands. It specifies that the
Wald test be carried out as {bind:W/k ~ F(k,d)} rather than as
{bind:(d-k+1)W/(kd) ~ F(k,d-k+1)}, where {bind:k = the dimension} of the
test and {bind:d = the total} number of sampled PSUs minus the total number
of strata.
{phang}
{opt minimum} is a highly technical option. It first performs the test
with the constant added. If this test is singular, coefficients are
dropped until the test becomes nonsingular. Then the test without the
constant is performed with the remaining terms.
{pstd}
The following option is available with {opt test} but is not shown in the
dialog box:
{phang}
{opt matvlc(matname)}, a programmers option, saves the
variance-covariance matrix of the linear combinations involved in the suite
of tests. For the test of the linear constraints L*b = c, {it:matname}
contains L*V*L', where V is the estimated variance-covariance matrix of b.
{title:Examples: after single-equation estimation except anova}
{phang2}{cmd:. regress y age female educ region1 region2 region3 region4}
{phang2}{cmd:. test region1 = region2 = region3}
{phang2}{cmd:. test region4 = (region1+region2)/2}
{phang2}{cmd:. test (region1 = region2) (region3 = region4)}
{phang2}{cmd:. test educ=.1}
{phang2}{cmd:. test region1 region2 region3 region4, mtest}
{phang2}{cmd:. testparm region*}
{pstd}
In the above example, you may substitute any single-equation estimation
command (such as {helpb clogit}, {helpb logistic}, {helpb logit},
{helpb ologit}, etc.) for {helpb regress}.
{title:Examples: after multiple-equation estimation commands}
{pstd}using {helpb mvreg} as an example{p_end}
{phang2}{cmd:. mvreg y1 y2 y3: x1 x3 x3 site1-site3}
{pstd}test y1 coefs = 0{p_end}
{phang2}{cmd:. test [y1]}
{pstd}test y1 site coefs = 0{p_end}
{phang2}{cmd:. test [y1]: site1 site2 site3}
{pstd}test all site coefficients are 0{p_end}
{phang2}{cmd:. test site1 site2 site3}
{pstd}test y1 coefficients = y2 coefs{p_end}
{phang2}{cmd:. test [y1=y2]}{p_end}
{phang2}{cmd:. test [y1=y2]: site1 site2 site3, mtest(bonf)}
{pstd}test y1 coefs = y2 coefs = y3 coefs{p_end}
{phang2}{cmd:. test [y1=y2=y3]} {p_end}
{phang2}{cmd:. test [y1=y2=y3]: site1 site2 site3}
{title:Examples: after {helpb mlogit}}
{phang2}{cmd:. mlogit y x1 x2 x3 site1 site2 site3}
{pstd}test y=1 coefs = 0{p_end}
{phang2}{cmd:. test [1]}
{pstd}test y=1 site coefs = 0{p_end}
{phang2}{cmd:. test [1]: site1 site2 site3}
{pstd}test y=1 coefficients = y=2 coefs{p_end}
{phang2}{cmd:. test [1=2]}
{phang2}{cmd:. test [1=2]: site1 site2 site3}
{pstd}test all site coefficients are 0{p_end}
{phang2}{cmd:. test site1 site2 site3}
{title:Examples: after {helpb reg3}}
{phang2}{cmd:. reg3 (y1 = x1 x2 x3) (y2 = x1 x3 x4) (y3 = x1 x2 x5)}
{pstd}test y1 coefs = 0{p_end}
{phang2}{cmd:. test [y1]}
{pstd}test equality common coefficients in y1, y2, y3: only x1{p_end}
{phang2}{cmd:. test [y1=y2=y3], common}
{pstd}test equality common coefficients in y1 and y2 (x1 x3 _cons) and in y1 and y3 (x1 x2 _cons){p_end}
{phang2}{cmd:. test ([y1=y2]) ([y1=y3]), common constant}
{title:Examples with {cmd:testparm}}
{pstd}{cmd:. testparm inc*}
{pstd}{cmd:. testparm inc*, equal equation(select)}
{title:Also see}
{psee}
Manual: {bf:[R] test}
{psee}
Online:
{helpb anova},
{helpb lincom},
{helpb linktest},
{helpb lrtest},
{helpb nlcom},
{help svy postestimation},
{helpb testnl}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -