I am a beginner STATA user/programmer and have run
into problems when trying to use an ado file.
I want to use an ado file to work with -svrest-,
however I'm running into problems when it gets to the
ado file trying to run.
I've been submitting the -svrset- part first. I then
try to submit the line
svrest "ml_try2", mat(e(b))
and here is where I run into problems.
Below you will find the code in my ado file.
--------- begin ml_try2.ado ----------------
program define mlcot
version 8.1
args lnf B0 B1 B2 sigma
tempvar res
quietly gen double `res' = logcot -
(`B0'-`B1'*(exp(-`B2'*smd720)))
quietly replace `lnf'=-0.5*ln(2*_pi) -ln(`sigma')
-0.5*`res'^2/`sigma'^2
end
ml model lf mlcot (B0:) (B1:) (B2:) (sigma:), robust
ml search
ml maximize
--------- end ml_try2.ado -----------------
I get the following error:
unrecognized command: mlcot
program mlcot not found
error when command executed on original dataset
invalid syntax
I don't know if there is something w/my ado file or
not. I do want to point out that when I run the
program above by itself, I have no problems & get
results. So I don't believe that there's anything
wrong with the coding to run the -ml- model.
Stata expects an ado-file to contain a program of the same name, ie the
ado-file -ml_try2.ado- should contain a program -ml_try2-, and -mlcot.ado-
should contain a program -ml_cot-. I think what Kat really wants to do is
to use -ml_try2.ado- as a do-file instead of an ado-file. To do this,
rename -ml_try2.ado- to -ml_try2.do-, and then run -ml_try2.do- by typing