Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Arguments in the -ml-


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Arguments in the -ml-
Date   Fri, 1 Feb 2008 10:25:22 +0000 (GMT)

--- "Mentzakis, Emmanouil" <[email protected]> wrote:
> When estimating a LogL function with -ml-, e.g.
> 
> program test
>   version 9.1
>   args lnf xb theta1
>       qui replace `lnf' = ln(...) if $ML_y1 == 1
>       qui replace `lnf' = ln(...) if $ML_y1 == 2
>        .
>        .
>        . 
> end
> 
> ml model lf test (y= ) / theta1
> ml maximize
> 
> How does Stata know that -xb- corresponds to the first equation and
> -theta1- to the second?
> 
> Should the order that the arguments appear in -args- be the same as
> the order they appear in the LogL?

I had a quick look around and I did not find an explicit statement of
that. Though by its very nature the use of the -args- command suggests
that it is the order in which the equations appear in the -ml model-
command (see: -help args-). This is confirmed by the quick experiment
below:

*-------------- begin example -----------------------
sysuse auto, clear
capture program drop mynormal_lf
program mynormal_lf
	version 8.1
	args lnf mu sigma
	quietly replace `lnf' = ln(normden($ML_y1, `mu', `sigma'))
end

ml model lf mynormal_lf (mpg = weight displacement) ()
ml search
ml maximize
ml model lf mynormal_lf () (mpg = weight displacement) 
ml search
ml maximize

exit
*-------------------- end example --------------------------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      ___________________________________________________________
Support the World Aids Awareness campaign this month with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index