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 at the end of May, and its replacement, statalist.org is already up and running.


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

st: 回复: st: Re: st: 回复: st: Re: st: 回复: st: error report with ml check


From   健 张 <victerzj2@yahoo.com.cn>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: 回复: st: Re: st: 回复: st: Re: st: 回复: st: error report with ml check
Date   Tue, 20 Sep 2011 02:21:15 +0800 (CST)

HI, Maarten
Thank you so much for your help! I am sorry for the misunderstanding that you wrote the code. I am also sorry for the messy code. It looks quite terrible. Dont know why so many As shown up by itself.


Best,
Jian



----- 原邮件 -----
发件人: Maarten Buis <maartenlbuis@gmail.com>
收件人: statalist@hsphsun2.harvard.edu
抄送: 
发送日期: 2011年9月19日, 星期一, 上午 4:38
主题: st: Re: st: 回复: st: Re: st: 回复: st: error report with ml check

On Fri, Sep 16, 2011 at 9:38 PM, å¥ å¼  <victerzj2@yahoo.com.cn> 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?searchhttp://www.stata.com/support/statalist/faqhttp://www.ats.ucla.edu/stat/stata/


*
*   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/


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