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

Re: st: nl -choice between alternative parametrisations of sigmoid models

From   "Rosy Reynolds" <>
To   "statalist" <>
Subject   Re: st: nl -choice between alternative parametrisations of sigmoid models
Date   Fri, 26 Oct 2007 10:40:35 +0100

Many thanks for the thought, and a neat trick. I could do as you suggest, but as that would be a 'home-grown' rather than a built-in function, I would have to take responsibility for choosing the starting values myself. The built-in -log4- function does something very neat about selecting starting values, and I appreciate that. (When I started out, I experimented with fitting the log4
model by typing it in myself like this
nl ( y1= {b0} + {b1}/(1 + exp(-{b2}*(x-{b3}))) )
It kept producing crazy results with a lot of dots in the tables, or failing to converge at all, and it took me a while to work out that it was not a mistake in my syntax but a need for good starting values.)
I would be interested to see how -log4- does pick its starting values, but I haven't found the code for it. -viewsource nl.ado- brings up the code for nl, but nothing to link up with the built-in functions. Do you have any idea where I could find the code for them?
best wishes

----- Original Message ----- From: "Austin Nichols" <>
To: <>
Sent: Thursday, October 25, 2007 5:03 PM
Subject: Re: st: nl -choice between alternative parametrisations of sigmoid

I haven't used -nl- in a while, but it seems to me that a model like
y= b0 + b1/(1 + exp(-b2*(x-b3))) +error
where b2>0 can be written
y= b0 + b1/(1 + exp(-b^2*(x-b3))) +error
with new parameter b, and b2=b^2 has to be positive.

On 10/25/07, Rosy Reynolds <> wrote:
I am fitting 4-parameter logistic (sigmoid Emax) dose-response models
the built-in -log4- feature of -nl-.

The model is  y= b0 + b1/(1 + exp(-b2*(x-b3))) + error
and the coefficients can be interpreted as
b0 = baseline outcome
b1 = Emax i.e. largest change from baseline
b2 = Hill or slope coefficient
b3 = ED50 i.e. value of x (dose) required to produce half-maximal effect,

The same curve can actually be produced with two different sets of these
In one set, the Hill slope b2 is positive and the other parameters
intuitively have the interpretations above.
In the other set, b2 is negative, the sign of b1 is reversed, and b0
the outcome at infinitely high dose instead of at the lowest doses. The
lowest-dose outcome is now given by b0+b1.

With our data, -nl- naturally produces the set of coefficients with
For ease of interpretation, I would prefer the set with positive b2.
I can push -nl- into doing that by supplying carefully chosen starting
values close to the desired coefficients. I could even run -nl- ,
the coefficients it obtains, and use those as starting values. That would
always work, I suppose, but it seems long-winded.

Please could you tell me an easier way to make -nl- parametrise the model
the preferred way, if you know of one? I haven't found anything about it
the manual.
Thanks for thinking about this.

best wishes
Rosy Reynolds
BSAC Resistance Surveillance Co-ordinator
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index