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