# [R] Info

Douglas Bates bates at stat.wisc.edu
Thu Jul 17 18:39:04 CEST 2003

```1) Please plot your data.  Notice that they are of the form y = x.
That is, they fall on a straight line.

2) Please plot the curve that you expect to fit.  You could do this,
as I have said in previous replies, by

library(nls)
example(SSfpl)

3) Please plot the four-parameter logistic with the values of the
parameters that you are using as starting estimates.  You could do
this by

x = seq(0, 5, by = 0.1)
plot(x, 0+(2-0)/(1+exp(-1.*(x-4.))), type = 'l')

4) Please look at this plot.  Notice where the points (1,1), (2,2),
(3,3), (4,4), and (5,5) would fall.  The curve that you are using
as a starting estimate is nowhere close to your data.

5) Please plot your data.  Print out the plot and draw by eye a
four-parameter logistic curve that you would feel would be a
reasonable interpolation curve.  Pay particular attention to the
position of the asymptotes.  Because your data fall exactly on a
straight line there is no possible way of determining the positions
of asymptotes.

others to your previous statements of this same question.  We spent
our time writing those explanations for you.  Please do us the

In this restatement of your question you state that nls could not fit
this model to these data.  As I am trying to get you to realize, the
reason for this is that there is no best fit of a four-parameter
logistic model to such data.  As you yourself write, the curve that
you are trying to fit has a "top asymptote" and a "bottom asymptote".
Your data are of the form y = x.  They have no curvature.  They fall
exactly on a straight line.  As a consequence there is absolutely no
information available from these data that can be used to estimate the
positions of asymptotes.  In fact I believe that the theoretical
values of a and c are -Inf and +Inf and the value of m is undefined.
(I think you have the designations of "top asymptote" and "bottom
asymptote" backwards.)

It is not a deficiency in R and in the abilities of the people who
respond to you on this list that we have not been able to give you a
piece of R code that does the impossible.  Continuing to ask the same
question several more times will not change this.  Instead of sending
the same question again please consult with someone at your
institution to have them explain why you cannot estimate four
parameters from data that fall on a straight line.

Andrea Calandra <a.CALANDRA at mclink.it> writes:

> Sorry
>
> I'm student in biomedical engineer and i have to solve this formula
> for immuno-assay. I need to design a calibration curve
>
> But i don't understand How can i write this formula in R language:
> y = a + (c - a) /(1+ e[-b(x-m])
>
> where
> x = ln(analyte dose + 1)
> y = the optical absorbance data
> a = the curves top asymptote
> b = the slope of the curve
> c = the curves bottom asymptote
> m = the curve X intercept
>
> I have to calculate the parameters (a,b,c,m).After with X that i know
> i calculate the Y.
>
>
> i try:
>
>
> yeld.fit <- nls( y ~ a + (c.-a)/(1+exp(-b*(x-m))),
>  data = yeld,
>  start = list( a= 0, c.=2, b= 1, m=4 ),
>  trace = TRUE )
>
>
> where yeld is a data.frame
>   x y
> 1 1 1
> 2 2 2
> 3 3 3
> 4 4 4
> 5 5 5
>
>
> but give me an error: << exceeded number of itwerations>>

```