Statalist The Stata Listserver


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

Re: st: heckprob: What are the initial values?


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: heckprob: What are the initial values?
Date   Sat, 2 Dec 2006 21:14:06 +0000 (GMT)

--- Rachel <[email protected]> wrote:
> I'm trying to change the starting values in heckprob. I've tried the
> from( ) option, but I can't tell exactly what argument Stata is
> looking for.
> 
> It looks like it's looking for the input arguments for the ml model
> function. According to the m file, those are the vectors xb1, xb2 and
> the number xb3 (rho).  I tried to use the option
> 
> from(xb1=arg1\xb2=arg2\xb3=0.5)
> 
> where arg1 and arg2 are the x1*b1 and x*b2 that I've already
> calculated based on the starting values I want, and 0.5 is my
> starting value of rho.

-help heckprob- points to -help maximize- for the ^from()^ option, and
that states that Stata expects values for the parameters that are to be
estimated. What you seem to feed it are linear predictors, and that
won't work. -help maximize- also tells you how to give Stata the
starting values. One option is to use a properly labeled matrix, like
in the example below.

Also note that Stata maximizes the arc-hyperbolic tangent of rho, which
is also known as the Fisher's Z transformation, and can be get with the
function atanh. So if you want to set the starting value for rho at .5,
you'll have to feed Stata atanh(.5).

HTH,
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

heckprob high educ higheduc sex black, /*
  */ select(employ = RegionNE RegionSE educ sex black hlth4 hlth5) /*
  */ from(b0)
*----------- 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/
-----------------------------------------

Send instant messages to your online friends http://uk.messenger.yahoo.com 
*
*   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