⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lrtest.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 03may2005}{...}
{cmd:help lrtest} {right:dialog:  {bf:{dialog lrtest}}}
{hline}

{title:Title}

{p2colset 5 19 21 2}{...}
{p2col :{hi:[R] lrtest} {hline 2}}Likelihood-ratio test after estimation{p_end}
{p2colreset}{...}


{title:Syntax}

{p 8 16 2}{cmd:lrtest} {it:modelspec1} [{it:modelspec2}] [{cmd:,} {it:options}]

{phang}
where {it:modelspec} is

{phang2}
{it:name}{c |}{cmd:.}{c |} {cmd:(}{it:namelist}{cmd:)}

{phang}
where {it:name} is the name under which estimation results were saved using
{helpb estimates:estimates store}, and "{cmd:.}" refers to the last estimation
results, whether or not these were already stored.

{synoptset 11}{...}
{synopthdr}
{synoptline}
{synopt :{opt st:ats}}display statistical information about the two
models{p_end}
{synopt :{opt di:r}}display descriptive information about the two models{p_end}
{synopt :{opt d:f(#)}}override the automatic degrees-of-freedom
calculation; seldom used{p_end}
{synopt :{opt force}}force testing even when apparently invalid{p_end}
{synoptline}
{p2colreset}{...}


{title:Description}

{pstd}
{cmd:lrtest} performs a likelihood-ratio test for the null hypothesis that
the parameter vector of a statistical model satisfies some smooth constraint.
To conduct the test, both the unrestricted and the restricted models must 
be fitted using the maximum likelihood method (or some equivalent method),
and the results of at least one must be stored using 
{helpb estimates:estimates store}.

{pstd}
{it:modelspec1} and {it:modelspec2} specify the restricted and unrestricted
model in any order.  {it:modelspec1} and {it:modelspec2} cannot have names in
common; for example, {cmd:lrtest {bind:(A B C)} {bind:(C D E)}} is not
allowed since both model specifications include {cmd:C}.  If {it:modelspec2}
is not specified, the last estimation result is used; this is equivalent to
specifying {it:modelspec2} as a period ({cmd:.}).

{pstd}
{cmd:lrtest} supports "composite models" specified by a parenthesized list of
model names.  In a composite model, we assume that the log likelihood and
dimension (number of free parameters) of the full model are obtained as the
sum of the log-likelihood values and dimensions of the constituting models.

{pstd}
{cmd:lrtest} provides an important alternative to {helpb test} for models
fitted via maximum likelihood or equivalent methods.


{title:Options}

{phang}
{opt stats} displays statistical information about the unrestricted and
restricted models, including the information indices of Akaike and Schwarz.

{phang}
{opt dir} displays descriptive information about the unrestricted and
restricted models; see {helpb estimates dir}.

{phang}
{opt df(#)} is seldom specified; it overrides the automatic degree-of-freedom
calculation.  

{phang}
{opt force} forces the likelihood-ratio test calculations to take place in
situations where {cmd:lrtest} would normally refuse to do so and issue an
error.  Such situations arise when one or more assumptions of the test are
violated, for example, if the models were fitted with {cmd:robust},
{cmd:cluster()}, or {helpb weight:pweight}s; the dependent
variables in the two models differ; the null log-likelihoods differ; the
samples differ; or if the estimation commands differ.  If you use the 
{opt force} option, there is no guarantee as to the validity or
interpretability of the resulting test.


{title:Remarks}

{pstd}
Under weak regularity conditions, the LR test statistic is approximately
chi-square distributed with degrees of freedom equal to the difference of
the dimensions of the unrestricted and restricted model (i.e., the
difference of the numbers of unrestricted and restricted parameters) if
the true parameter vector indeed satisfies the restricted model, and if
we are not "on a boundary of the parameter space".  The latter condition
is not satisfied, for instance, if we are  testing whether the variance
of a mixing distribution equals zero ({help j_chibar:click here} for more
information).  {cmd:lrtest} is not able to discern whether it is being
invoked under such conditions, and it always produces p-values assuming
that the standard regularity conditions are satisfied.

{pstd}
{cmd:lrtest} provides an important alternative to {help test:Wald testing} for
models fitted by maximum likelihood.  Wald testing requires fitting only one
model (the unrestricted model).  Hence, it is computationally more attractive
than likelihood-ratio testing.  Most statisticians, however, favor using
likelihood-ratio testing whenever feasible since the null-distribution of the
LR test statistic is often "more closely" chi-square distributed than the Wald
test statistic.


{title:Examples}

{phang}{cmd:. logit chd age age2 sex}{p_end}
{phang}{cmd:. est store A}{p_end}
{phang}{cmd:. logit chd age sex}{p_end}
{phang}{cmd:. lrtest A}{p_end}
    {cmd:. lrtest A .}    {right:(equivalent to previous command)  }
{phang}{cmd:. est store B}{p_end}
{phang}{cmd:. logit chd sex}{p_end}
{phang}{cmd:. est store C}{p_end}
{phang}{cmd:. lrtest B}{p_end}
{phang}{cmd:. lrtest C A, stats}{p_end}


{title:Examples with composite models}

{pstd}
We want to test in {helpb heckman} that participation decision is stochastically
independent of the outcome (wage rate).  If this correlation is 0, heckman's
model is equivalent to the combination of a {cmd:regress} for the outcome and
a {cmd:probit} model for participation.

{phang}{cmd:. heckman wage age edu, sel(kids age edu)}{p_end}
{phang}{cmd:. est store H}{p_end}
{phang}{cmd:. regress wage age edu}{p_end}
{phang}{cmd:. est store R}{p_end}
{phang}{cmd:. gen dinc = !missing(wage)}{p_end}
{phang}{cmd:. probit dinc kids age edu}{p_end}
{phang}{cmd:. est store P}{p_end}
{phang}{cmd:. lrtest H (R P), df(1)}{p_end}

{pstd}
Chow-type tests are appropriate for hypotheses that specify that all
coefficients of a model do not vary between disjoint subsets of the data.

{phang}{cmd:. logit depvar xlist}{p_end}
{phang}{cmd:. est store All}

{phang}{cmd:. logit depvar xlist if regiem1}{p_end}
{phang}{cmd:. est store A1}{p_end}
{phang}{cmd:. logit depvar xlist if regiem2}{p_end}
{phang}{cmd:. est store A2}{p_end}
	...
{phang}{cmd:. lrtest (All) (A1 A2 ..), df(}{it:#}{cmd:)}{p_end}


{title:Also see}

{psee}
Manual:  {bf:[R] lrtest}

{psee}
Online:  {help estimation commands}, {helpb linktest}, {helpb test},
{helpb testnl}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -