|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: How to convert a do-file (that uses ml functions) into an ado file
From |
"Tiago V. Pereira" <[email protected]> |
To |
[email protected] |
Subject |
st: How to convert a do-file (that uses ml functions) into an ado file |
Date |
Thu, 18 Dec 2008 20:12:44 -0200 (BRST) |
Thank you so much Martin and Nick for your expert opinion about my
problem. I have corrected that errors, but the same problem continues.
It is interesting to note that the do-file works well. However, I have
copied and pasted the do-file (except the part related to the data) into a
do file, and this ado file also returns the same error.
Using -set trace on- I got the following (only partially reported here)
output (the specific line is outlined with !!!!!!!!!!:
-------------------------------------------------------------------------
end _mkvec.From ---
- local copy `s(copy)'
= local copy
- local skip `s(skip)'
= local skip
- if "`copy'"!="" {
= if ""!="" {
CopyMat `mat' `"`error'"' `s(from)'
if `"`colname'"'!="" {
local dim : word count `colname'
if `dim' != colsof(matrix(`mat')) {
di in red `"`error'matrix must "' `"be dimension "' `dim'
exit 503
}
mat colnames `mat' = `colname'
}
}
- else {
- BuildMat `mat' `"`error'"' "`skip'" `s(from)'
= BuildMat __000000 `"initial vector: "' "" lambda:_cons= b2:_cons=
logvar2:_cons=;
-------------------------------------------------------------------
begin _mkvec.BuildMat ---
- args matall error skip
- macro shift 3
- tokenize `"`*'"', parse(" =")
= tokenize `"lambda:_cons= b2:_cons= logvar2:_cons=;"', parse(" =")
- tempname matadd
- local i 1
- while "``i''"!="" {
= while "lambda:_cons"!="" {
- local k = `i' + 1
= local k = 1 + 1
- if "``k''"=="=" {
= if "="=="=" {
- local j = `i' + 2
= local j = 1 + 2
- MkMat `matadd' ``i'' ``j'' `skip'
= MkMat __000001 lambda:_cons b2:_cons
--------------------------------------------------------------------
begin _mkvec.MkMat ---
- args mat el_name z skip
- confirm number `z'
= confirm number b2:_cons
'b2' found where number expected !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
----------------------------------------------------------------------
end _mkvec.MkMat ---
local i = `i' + 3
}
else {
ChkMat `matadd' ``i'' `"`error'"'
local i = `i' + 1
}
mat `matall' = nullmat(`matall') , `matadd'
}
---------------------------------------------------------------------
end _mkvec.BuildMat ---
if `"`colname'"'!="" {
ChkNames `mat' "`matin'" `"`colname'"' `"`error'"' "`skip'" "`first'"
local fill `s(k_fill)'
}
}
}
--------------------------------------------------------------------------------
end _mkvec ---
---------------------------------------------------------------------------------
end ml_init ---
exit
}
----------------------------------------------------------------------------------------
end ml ---
(error occurred while loading ml_fuck.ado)
r(7);
Thanks again for any additional tip!
Cheers!
Tiago
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/