Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: My program does not accept more than two args
From
Tirthankar Chakravarty <[email protected]>
To
[email protected]
Subject
Re: st: My program does not accept more than two args
Date
Sun, 2 May 2010 04:02:08 +0530
Try this:
**************************************************
sysuse auto, clear
cap prog drop normreg
program define normreg
version 11.0
args lnf mu sigma
qui replace `lnf'=log(normalden(($ML_y1-`mu')/`sigma')) ///
-log(`sigma')
end
ml model lf normreg (mean: mpg=weight length) (variance:)
ml check
ml max
**************************************************
T
2010/5/2 Richard Williams <[email protected]>:
> At 05:04 PM 5/1/2010, francesco manaresi wrote:
>>
>> This may be obvious, if so I apologize in advance: I am a newbie in
>> programming.
>> I want to implement a maximum-likelihood estimate, but got problems in
>> letting the program accept more than 2 arguments (in args).
>> Consider the simplest case: a normal model. The program is:
>
> Incidentally, I highly recommend Stata's ML programming book:
>
> http://www.stata.com/bookstore/mle.html
>
> That page includes links to the programs and data sets used in the book.
>
>
> -------------------------------------------
> Richard Williams, Notre Dame Dept of Sociology
> OFFICE: (574)631-6668, (574)631-6463
> HOME: (574)289-5227
> EMAIL: [email protected]
> WWW: http://www.nd.edu/~rwilliam
>
> *
> * 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/
>
--
To every ω-consistent recursive class κ of formulae there correspond
recursive class signs r, such that neither v Gen r nor Neg(v Gen r)
belongs to Flg(κ) (where v is the free variable of r).
*
* 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/