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]
st: Re: st: 回复: st: Re: st: 回复: st: error report with ml check
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
st: Re: st: 回复: st: Re: st: 回复: st: error report with ml check
Date
Mon, 19 Sep 2011 10:38:02 +0200
On Fri, Sep 16, 2011 at 9:38 PM, �张 <[email protected]> wrote:
> Hi, Maarten:
> Thank you for your reply. I have read the bipp_lf.ado. It is really quite different from what I wrote. Right now, I am just working on the simplest case, the linear restriction case.
>
> The code for the linear restriction case is like this:
> program define bipp_lf
> version 6.0
> local ll "`1'" /* Log l */
> local xb1 "`2'" /* x1*b1 */
> local xb2 "`3'" /* x2*b2 */
> local kappa "`4'" /* atanh(rho) */
>
>
> local rr = (exp(2*`kappa')-1) / (exp(2*`kappa')+1)
>
> if `kappa' < -18 { local rr = -1 }
> if `kappa' > 18 { local rr = 1 }
>
> quietly {
> replace `ll' = binorm(`xb1',`xb2',`rr')
> replace `ll' = 1-`ll' if $ML_y1 == 0
> replace `ll' = log(`ll')
> }
> end
>
> I have several questions regarding the code:
> What does those "`1'" , "`2'" , "`3'" , "`4'" stand for? I can understand the explaining part behind them. However, I dont see where you use those 1,2,3,4.
This is code by StataCorp not me, so I can only guess. this looks to
me like old code that precedes or chose not to use -args-. If you call
a program, than the first argument will be assigned to local `1', the
second to `2', etc. -args- will do the same as those lines.
> Why do you need to generate kappa? Why do you use the function
atanh(.) to generage kappa? For rr, did you parameterized kappa so
that the range can be (-infinity, infinity), which is as the technique
note on P56 of Maximum Likelihood Estimation in Stata, Gould, Pitblado
and Sribney, Stata Press: 3d ed., 2006? If not, why do you generate
rr?
Again, I did not write this code, so I can still only guess. This
looks like it maximizes with respect to the Fisher's z transformed
correlation coefficient.
> Where do 18 and -18 come from?
My guess would be from either experience or simulations or both.
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/