Statalist The Stata Listserver


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

Re: st: Equivalence of Heckprob and ml model commands--initial values of rho


From   Rachel <[email protected]>
To   [email protected]
Subject   Re: st: Equivalence of Heckprob and ml model commands--initial values of rho
Date   Thu, 7 Dec 2006 13:55:44 -0500

Following up: The problem was that I hadn't invoked the nosearch
option on ml model, as had heckprob.  Problem is solved for now.

On 12/7/06, Rachel <[email protected]> wrote:
Hi Martin,

Thanks very much for your reply.  I understand that in both cases, the
program is estimating parameters for atanh(rho).  However, my question
is a simpler one:

I looked at the initial values for Heckprob, which include
athrho=atanh(rho).  I fed all these initial values into ml model
(eqn1) (eqn2) /athrho, max trace gradient as shown below.

But when I look at the results of the 0th iteration for both, the
parameter values match for all parameters *except* athrho.    I don't
understand why this is, since both should be equivalent.  In the
heckprob case, the initial value results from a calculation within the
program.  In the case of simply calling ml model heckp_lf ...  , the
calculation doesn't take place, so the initial value should remain as
it was specified.

Why the difference?

Thanks,
Rachel


On 12/7/06, Maarten buis <[email protected]> wrote:
> --- Rachel <[email protected]> wrote:
> > Suppose the initial values displayed in the 0th iteration of heckprob
> > are b1.....bn, atrho.
> >
> >
> > Now suppose I try to replicate the heckprob command using the same
> > two equations:
> >
> > ml model (`maindv'=`depvars1') (`seldv'=`depvars2')  /athrho, trace
> > max gradient init(b1.....bn, atrho).
> >
> > In the 0th iteration of this command, all the initial values of the
> > coefficients match those given in the init command EXCEPT for atrho.
> > (Note again that I passed the program atanh(rho), the initial value
> > calculated by heckprob and displayed as the initial value)
>
> You are doing nothing wrong. What you are maximizing is the Fisher's Z
> transformed correlation (= atanh(rho)). With maximum likelihood you are
> trying out different values of rho and the other coefficients and
> calculate the probability of observing the data you have observed given
> those parameters (the likelihood) and you choose those values of the
> parameter that maximize those probabilities. Stata and other programs
> use a smart way of trying out different values and that smart way is
> helped if all parameters can take on every positive or negative number.
> Rho, the correlation, can only take on values between -1 and 1, but the
> Fisher's Z transformed rho can take on every positive or negative
> number. That's why -heckprob- maximizes atanh(rho) and not rho. So if
> you feed as starting value atanh(.50), you need to compare it not with
> .50 but with atanh(.50), which you can see when you type -di
> atanh(.50)-. See the example below which is slighly extended from an
> example I gave a couple of days ago.
>
> hope this helps,
> Maarten
>
> *-------------- begin example --------------------------
> use http://www.stata-press.com/data/r9/gss1991.dta, clear
> sum prestg80
> gen high = prestg80 > r(mean) if unemploy == 0
> gen employ =! unemploy
> gen higheduc = max(maeduc, paeduc)
>
> probit high educ higheduc sex black
> matrix b0 = e(b)
> local coln : colnames b0
> foreach name of local coln {
>         local colname "`colname' high:`name'"
> }
>
> probit employ RegionNE RegionSE educ sex black hlth4 hlth5
> matrix temp = e(b)
> local coln : colnames temp
> foreach name of local coln {
>         local colname "`colname' employ:`name'"
> }
> local colname "`colname' athrho:_cons"
> matrix b0 = b0, temp, atanh(.5)
> matrix colname b0 = `colname'
> matrix list b0
>
> di atanh(.50)
> heckprob high educ higheduc sex black, /*
>   */ select(employ = RegionNE RegionSE educ sex black hlth4 hlth5) /*
>   */ from(b0) trace
> *----------- end example -----------------------
>
>
>
> -----------------------------------------
> 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/
> -----------------------------------------
>
>
>
>
>
> ___________________________________________________________
> All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
> http://uk.docs.yahoo.com/nowyoucan.html
> *
> *   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/
>

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