Statalist


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

Re: st: Constraint nl estimation


From   "Joseph Coveney" <[email protected]>
To   "Statalist" <[email protected]>
Subject   Re: st: Constraint nl estimation
Date   Tue, 4 Mar 2008 13:48:26 +0900

I could have been clearer on what exactly to do with -invlogit()- in
specifying the model.  The transformation, -invlogit(g)-, is defined in the
functional model in order to allow the fitted coefficient, g, itself, to
take on any real value.  This makes it easier for the algorithm to find a
solution.  Afterward, transform the model-fitted coefficient (and confidence
bounds) in order to obtain the value that you're looking for.

Joseph Coveney

clear *
set more off
set seed `=date("2008-03-05", "YMD")'
set obs 20
generate double x1 = invnormal(uniform())
generate double x2 = invnormal(uniform())
generate double y = 0.75 * x1 + ///
 (1 - 0.75) * x2 + invnormal(uniform()) / 10
nl (y = invlogit({g}) * x1 + (1 - invlogit({g})) * x2) // <- Here
display in smcl as result %04.2f invlogit(_b[/g]) // <-and here.
exit


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