Hi all,
I estimated a VAR model using the standard var-command and want to run a function called varmodtest afterwards. The function simply exploits the "modtest" command and merges different specification test results into a matrix which is passed back.
<hansl>
function matrix varmodtest (scalar order "Lag length")
#Serial correlation
modtest order --autocorr --quiet
matrix OUTSC = $pvalue' | $test'
return OUTSC
end function