Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: st : Calling a ML program in an ado file

From   Valerie Orozco <>
To   "" <>
Subject   st: RE: st : Calling a ML program in an ado file
Date   Mon, 12 Jul 2010 12:56:22 +0000

Thank you Nick. It works!
But what's the difference between  a standard ado file?
For example, the following ado file is composed by 2 ado and it works (titi is known when called.)

/*----------------------------- begin toto.ado-----------------------------*/    
program toto
    version 11.1 
    di in red "toto is running"

program titi   
    version 11.1
    di "titi is in toto.ado"

/*----------------------------- end toto.ado-----------------------------*/      

Thank you.


  "Nick Cox" <>
  st: RE: Calling a ML program in an ado file
  Mon, 12 Jul 2010 11:41:39 +0100
Try putting your -myprobit- program in a separate file -myprobit.ado-. 


-----Message d'origine-----
De : Valerie Orozco 
Envoyé : lundi 12 juillet 2010 12:30
À : ''
Objet : Calling a ML program in an ado file


I would like to create some ado-files in order to replicate some estimations on several data.
I have some problems calling ml program in my ado (they are not known).

Let's take a small example : 

/*----------------------------- begin Example.ado-----------------------------*/
program Example
    version 11.1
    args varY X1 X2
    di "Call myprobit"
    ml model lf myprobit (`varY' = `X1'  `X2')
    ml maximize

program myprobit
    version 11
    args lnf theta1
    quietly replace `lnf' = ln(normal(`theta1')) if $ML_y1==1
    quietly replace `lnf' = ln(normal(-`theta1')) if $ML_y1==0
/*----------------------------- end Example.ado-----------------------------*/

Running the ado "Example" gives the following message : 

. Example foreign mpg weight
(1978 Automobile Data)
Call myprobit
unrecognized command:   myprobit

I don't understand why the program "myprobit", written in the ado file, remains unknown...
What is my mistake???
Thanks a lot.


Valérie OROZCO
Toulouse School of Economics (INRA-GREMAQ)
21, allée de Brienne
F-31000 Toulouse, France

MA 101
+33 5 61 12 85 91

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index