{p 4 8}{cmd:vuong} - Performs Vuong (1989 Econometrica) test comparing (possibly)
non-nested linear regression specifications. {p_end}
{title:Syntax}
{p 4 6 2}
{cmd:vuong}
{it:modelA modelB}
{title:Description}
{p 4 4 2}
{cmd:vuong} computes the Vuong (1989 Econometrica) test as implemented in Dechow (1994 Journal of Accounting and economics. The test statistic is obtained by first computing the following quantity for each observation i:{p_end}
{p 4 4 2}
where RSSa is the residual sum of squares for regression specification A and ea(i) is observation i's residual in regression specification A. The definitions of RSSb and eb(i) are similar for regression specification B. n is the number of observations in the regression.
{p_end}
{p 4 4 2}
The test statistic is computed by regressing the m(i)'s on a constant. The t-statistic on the constant, multiplied by -sqrt[(n-1)/n], is the Z-statistic for the Vuong test. A positive value indicates that {it:modelA} is better specified than {it:modelB} and vice versa.
{p_end}
{title:Example}
{phang}{stata "reg y x" : . reg y x}{p_end}
{phang}{stata "est store modA" : . est store modA}{p_end}
{phang}{stata "reg y z" : . reg y z}{p_end}
{phang}{stata "est store modB" : . est store modB}{p_end}
{phang}{stata "vuong modA modB" : . vuong modA modB}{p_end}
******************************
* vuong.ado
* Judson A. Caskey
* UCLA
* 26-Apr-2007
*
* Computes Vuong (1989 Econometrica) test
* of two non-nested regressions as implemented
* and described in Dechow (1994 Journal of
* Accounting and Economics)
*
******************************
cap prog drop vuong
prog define vuong, rclass
syntax [anything]
tempname mod1 mod2 rss1 rss2 rsq1 rsq2 n zstat pval nbad
tempvar s1 s2 e1 e2 m
if `"`: word count `anything''"' ~= "2" {
di as err "You must specify two distinct models"
exit
}
est_expand `"`anything'"', min(1) max(2)
local `mod1' : word 1 of `r(names)'
local `mod2' : word 2 of `r(names)'
if "``mod1''"=="``mod2''" {
di as err "You must specify two distinct models"
exit
}
quietly estimates restore ``mod1''
local `rss1'=e(rss)
local `rsq1'=e(r2)
quietly _predict `e1' if e(sample), resid
quietly gen `s1'=e(sample)
quietly estimates restore ``mod2''
local `rss2'=e(rss)
local `rsq2'=e(r2)
quietly _predict `e2' if e(sample), resid
quietly gen `s2'=e(sample)
quietly count if `s1'==1 & `s2'==1 & ~missing(`e1',`e2')
local `n'=r(N)
quietly gen `m'=log(``rss1''/``rss2'')/2 + ``n''*((`e1'^2)/``rss1'' - (`e2'^2)/``rss2'')/2 if `s1'==1 & `s2'==1 & ~missing(`e1',`e2')
quietly reg `m'
local `zstat'=-sqrt((e(N)-1)/e(N))*_b[_cons]/_se[_cons]
local `pval'=(1-normal(abs(``zstat'')))*2
di as result _column(20) " Model 1" _column(35) " Model 2"
di as result "R-Squared" _column(20) %10.4f ``rsq1'' _column(35) %10.4f ``rsq2''
di as result ""
di as result "Vuong Z-Statistic" _column(20) %10.4f ``zstat''
di as result " p-value" _column(20) %10.4f ``pval''
quietly count if (`s1'==1 & `s2'==0) | (`s1'==0 & `s2'==1)
local `nbad'=r(N)
di as result ""
if ``nbad''>0 di as err "``nbad'' observations in one model but not the other"