Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Initial values using -ml-


From   kat jackson <kejstats@yahoo.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Initial values using -ml-
Date   Fri, 19 Sep 2003 07:37:22 -0700 (PDT)

I am trying to run a model using -ml-.  I'm getting
the error (491) which says it could not find feasible
values.  I have tried the repeat option w/search.  I
also tried inputting initial values.  While I believe
the initial values I am using are good initial values,
the program is still not finding feasible values.  
With that, I want to make sure my syntax is correct.

This is the code I have:

capture program drop mlrace
use l:\nhanes9900\ralph_paper\stata_play\nhanes.dta

matrix parminit =(5.7, .3, .05, 2.9, .3, .15, .4, .2,
.1, .5)
matrix list parminit
program define mlrace
	version 8.1
	args lnf B0 B0race1 B0race2 B1 B1race1 B1race2 B2
B2race1 B2race2 sigma
	tempvar res
	quietly gen double `res' = logcot - ((`B0'+
`B0race1'*d_race1+ `B0race2'*d_race2) - (`B1' +
`B1race1'*d_race1+ `B1race2'*d_race2)*(exp(-(`B2' +
`B2race1'*d_race1 + `B2race2'*d_race2)*smd720)))
	quietly replace `lnf'=-0.5*ln(2*_pi) -ln(`sigma')
-0.5*`res'^2/`sigma'^2
end

ml model lf mlrace (B0:) (B0race1:) (B0race2:) (B1:)
(B1race1:) (B1race2:) (B2:) (B2race1:) (B2race3:)
(sigma:) [pw=wtmec2yr] , robust
*ml search
ml init parminit, copy 
ml maximize


Thanks.
-Kat

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.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–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index