4 parameter logistic fit

15 posts / 0 new
Last post
desmondo84
desmondo84's picture
4 parameter logistic fit

Hi,
I'm very much a novice to working working with elisas!  From what I gather, it is usually unwise to use linear regression to interpolate data and a 4-parameter logistic fit may be a better choice.  Is this possible to do in excel?  Or can someone recommend some software?
Thanks in advance, 

MsV
MsV's picture
Excel seems to be fairly poor

Excel seems to be fairly poor for anything other than basic stats (from my limited and software ignorant position). Do you have SPSS or Prism? Sadly I came from a background of having wonderful software linked to our reader which involved me plugging in my plate plan and it giving me all the data.
Beware, this is wonderful for giving you effortless answers but rubbish if you want to be able to do it in the event of having a more basic setup when you don't know how to calculate the concentrations yourself (as I am experiencing now).

fcs
fcs's picture
Hi,

Hi,

The 4-parameter logistic assumes symmetry around the inflection point.  A better option would be the 5-parameter logistic which takes aymmetry into account (hence the 5th parameter) which is a better fit for bioassays.  Here is a blog post for detail on the 5-parameter logistic model equation.

We do offer an elisa analysis software, MasterPlex ReaderFit, which includes both the 4-PL and 5-PL model equations as well as a couple of others in addition to weighting algorithms.  I would like to welcome you to try out our free 14-day trial.

Another great thing about the 4-PL (if you are doing dose response curves) is that the C parameter represents your EC50 or IC50 value depending on the type of assay you are doing.  For the 5-PL, the EC50/IC50 would be a function of the followin:

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">

UnhideWhenUsed="false" QFormat="true" Name="Normal" />

UnhideWhenUsed="false" QFormat="true" Name="heading 1" />

UnhideWhenUsed="false" QFormat="true" Name="Title" />

UnhideWhenUsed="false" QFormat="true" Name="Subtitle" />

UnhideWhenUsed="false" QFormat="true" Name="Strong" />

UnhideWhenUsed="false" QFormat="true" Name="Emphasis" />

UnhideWhenUsed="false" Name="Table Grid" />

UnhideWhenUsed="false" QFormat="true" Name="No Spacing" />

UnhideWhenUsed="false" Name="Light Shading" />

UnhideWhenUsed="false" Name="Light List" />

UnhideWhenUsed="false" Name="Light Grid" />

UnhideWhenUsed="false" Name="Medium Shading 1" />

UnhideWhenUsed="false" Name="Medium Shading 2" />

UnhideWhenUsed="false" Name="Medium List 1" />

UnhideWhenUsed="false" Name="Medium List 2" />

UnhideWhenUsed="false" Name="Medium Grid 1" />

UnhideWhenUsed="false" Name="Medium Grid 2" />

UnhideWhenUsed="false" Name="Medium Grid 3" />

UnhideWhenUsed="false" Name="Dark List" />

UnhideWhenUsed="false" Name="Colorful Shading" />

UnhideWhenUsed="false" Name="Colorful List" />

UnhideWhenUsed="false" Name="Colorful Grid" />

UnhideWhenUsed="false" Name="Light Shading Accent 1" />

UnhideWhenUsed="false" Name="Light List Accent 1" />

UnhideWhenUsed="false" Name="Light Grid Accent 1" />

UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" />

UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" />

UnhideWhenUsed="false" Name="Medium List 1 Accent 1" />

UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" />

UnhideWhenUsed="false" QFormat="true" Name="Quote" />

UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" />

UnhideWhenUsed="false" Name="Medium List 2 Accent 1" />

UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" />

UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" />

UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" />

UnhideWhenUsed="false" Name="Dark List Accent 1" />

UnhideWhenUsed="false" Name="Colorful Shading Accent 1" />

UnhideWhenUsed="false" Name="Colorful List Accent 1" />

UnhideWhenUsed="false" Name="Colorful Grid Accent 1" />

UnhideWhenUsed="false" Name="Light Shading Accent 2" />

UnhideWhenUsed="false" Name="Light List Accent 2" />

UnhideWhenUsed="false" Name="Light Grid Accent 2" />

UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" />

UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" />

UnhideWhenUsed="false" Name="Medium List 1 Accent 2" />

UnhideWhenUsed="false" Name="Medium List 2 Accent 2" />

UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" />

UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" />

UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" />

UnhideWhenUsed="false" Name="Dark List Accent 2" />

UnhideWhenUsed="false" Name="Colorful Shading Accent 2" />

UnhideWhenUsed="false" Name="Colorful List Accent 2" />

UnhideWhenUsed="false" Name="Colorful Grid Accent 2" />

UnhideWhenUsed="false" Name="Light Shading Accent 3" />

UnhideWhenUsed="false" Name="Light List Accent 3" />

UnhideWhenUsed="false" Name="Light Grid Accent 3" />

UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" />

UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" />

UnhideWhenUsed="false" Name="Medium List 1 Accent 3" />

UnhideWhenUsed="false" Name="Medium List 2 Accent 3" />

UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" />

UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" />

UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" />

UnhideWhenUsed="false" Name="Dark List Accent 3" />

UnhideWhenUsed="false" Name="Colorful Shading Accent 3" />

UnhideWhenUsed="false" Name="Colorful List Accent 3" />

UnhideWhenUsed="false" Name="Colorful Grid Accent 3" />

UnhideWhenUsed="false" Name="Light Shading Accent 4" />

UnhideWhenUsed="false" Name="Light List Accent 4" />

UnhideWhenUsed="false" Name="Light Grid Accent 4" />

UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" />

UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" />

UnhideWhenUsed="false" Name="Medium List 1 Accent 4" />

UnhideWhenUsed="false" Name="Medium List 2 Accent 4" />

UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" />

UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" />

UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" />

UnhideWhenUsed="false" Name="Dark List Accent 4" />

UnhideWhenUsed="false" Name="Colorful Shading Accent 4" />

UnhideWhenUsed="false" Name="Colorful List Accent 4" />

UnhideWhenUsed="false" Name="Colorful Grid Accent 4" />

UnhideWhenUsed="false" Name="Light Shading Accent 5" />

UnhideWhenUsed="false" Name="Light List Accent 5" />

UnhideWhenUsed="false" Name="Light Grid Accent 5" />

UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" />

UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" />

UnhideWhenUsed="false" Name="Medium List 1 Accent 5" />

UnhideWhenUsed="false" Name="Medium List 2 Accent 5" />

UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" />

UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" />

UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" />

UnhideWhenUsed="false" Name="Dark List Accent 5" />

UnhideWhenUsed="false" Name="Colorful Shading Accent 5" />

UnhideWhenUsed="false" Name="Colorful List Accent 5" />

UnhideWhenUsed="false" Name="Colorful Grid Accent 5" />

UnhideWhenUsed="false" Name="Light Shading Accent 6" />

UnhideWhenUsed="false" Name="Light List Accent 6" />

UnhideWhenUsed="false" Name="Light Grid Accent 6" />

UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" />

UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" />

UnhideWhenUsed="false" Name="Medium List 1 Accent 6" />

UnhideWhenUsed="false" Name="Medium List 2 Accent 6" />

UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" />

UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" />

UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" />

UnhideWhenUsed="false" Name="Dark List Accent 6" />

UnhideWhenUsed="false" Name="Colorful Shading Accent 6" />

UnhideWhenUsed="false" Name="Colorful List Accent 6" />

UnhideWhenUsed="false" Name="Colorful Grid Accent 6" />

UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" />

UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" />

UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" />

UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" />

UnhideWhenUsed="false" QFormat="true" Name="Book Title" />

/* Font Definitions */
@font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-alt:"MS 明朝";
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:1;
mso-generic-font-family:roman;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:"\@MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-charset:128;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0in;
margin-right:0in;
margin-bottom:10.0pt;
margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"MS Mincho";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;
mso-fareast-language:JA;}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
{mso-style-priority:1;
mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"MS Mincho";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;
mso-fareast-language:JA;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"MS Mincho";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;
mso-fareast-language:JA;}
.MsoPapDefault
{mso-style-type:export-only;
margin-bottom:10.0pt;
line-height:115%;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}

x = c(2^(1/e)  -1)^(1/b)
 
c = inflection point on the curve (same as in 4PL)
b = slope parameter (same as in 4PL)
e = asymmetry parameter (not present in 4PL)

Here is a blog post on dose response curves with automatic EC50 & IC50 calculation using MasterPlex ReaderFit.

He also have some pre-recorded webinars that goes into elisa analysis with MasterPlex ReaderFit.

I would also be more than happy to address any other questions/issues that you might have regarding elisa analysis.

Allen

MiraiBio

MyAssays
MyAssays's picture
Hi,

Hi,
Try http://www.myassays.com/four-parameter-fit.assay

It’s free, requires no install and pre-configured for ELISAs

AW

Rajeshwari patel
Rajeshwari patel's picture
 hi desmondo,

 hi desmondo,

Excel is not good choice

I think
Prism  and other softwares are good but in my experieance  For 4 -parameter logistic Softmax Pro is very good software this is available on molecular device site for 60 days free demo

Which is very user freindly

Regards
rajeshwari

fcs
fcs's picture
Hitachi Solutions just

Hitachi Solutions just recently launched a free online ELISA analysis application called ReaderFit.com.  It fully supports the 4 parameter logistic (4PL) and 5 parameter logistic (5PL) models with weighting options.  ReaderFit.com also interpolates and extrapolates unknown values.

The 4PL and 5PL algorithms are 8+ years in the making and has gone through several iterations since it's initial launch in our MasterPlex QT multiplex analysis software.

The registration process is simple: If you are already logged into Google it only takes one click to register and you can begin analysis immediately.  If not, all you need is an email address and password to begin using the application.

If you have any questions regarding ELISA analysis or usage of ReaderFit.com, I'd be more than happy to assist you.  You can reach me at aliu [at] miraibio [dot] com.

Allen Liu
Hitachi Solutions

elisamodel
elisamodel's picture
You can fit an ELISA curve

You can fit an ELISA curve using free software called R.

The 4 parameter model is:
y = (a-d)/[1+(x/c)^b]+d

You can solve for x:
x = c ((-a + y)/(d - y))^(1/b)

x is log concentrations, y is OD signal read from your instrument.

Get your data into a dataframe and take the log of the concentration (R code in red):

###############  Clears All Data  ###############
rm(list=ls())

#################  Data input  #################
#input the data

stdcrvdata<-data.frame(conc=c(3,10,30,100,300,1000,3000,10000,30000), OD=c(.2,.22,.41,.75,1.07,1.18,1.2,1.27,1.29))

stdcrvdata$logconc <-log10(stdcrvdata$conc)

plot(stdcrvdata$logconc, stdcrvdata$OD, main="log standard curve", xlab="x=log(conc)", ylab="y=OD")

When you plot the data you can see the top of the curve which equals parameter a and the bottom is parameter d. The inflection point on the curve is parameter c and b is the degree of curvature. Use these values for seeding your parameters in the next step. Play with the equation in excel to see what changing the  numbers does.

Next step is the non-linear fit, the seeded/starting parameters are in start=list(). If you pick bad ones your fit will fail. I am using cc instead of c because I think c is a reserved letter (not sure).

##################  fit the data  ##################
fit <- nls(OD ~ d+(a-d)/(1+(logconc/cc)^b), data=stdcrvdata, start=list(d=0.2, a=1.5, cc=2, b=-11), trace=TRUE)
summary(fit)

Then lets plot the fit. Look at your original plot and find the lowest and highest x values you want to use. We make a list of numbers (mine go from .5 to 4.5)

################  Plot the results  ################
#this lets you graph your calculated equations nice and pretty
x <- seq(.5,4.5, length=100)
y <- (coef(fit)["d"]+(coef(fit)["a"]-coef(fit)["d"])/(1+(x/coef(fit)["cc"])^coef(fit)["b"]))

Then add a red line showing your fit to your already generated plot

lines(x,y, lty="dotted", col="red")

Next we have our unknowns, you can take the parameters calculated from R and use the equations in excel, or this is the R code.

Using the equation above and the parameters determined from fitting our model (stored in the object fit) we input our measured OD data into a dataframe called samples. Then we solve using the equation, convert the calculated log concentration to concentration and our answer is returned to us. The write.table outputs our data in a .csv format for inputting into excel.

##################  Calculate unknowns  ##################
samples<-data.frame(OD=c(.27,.19,1.2))
samples$loganswer<-coef(fit)["cc"]*(((-1*coef(fit)["a"]+samples$OD)/(coef(fit)["d"]-samples$OD))^(1/coef(fit)["b"]))
samples$conc <- 10^samples$loganswer
samples

write.table(samples,file="mydata.csv",sep=",")

Finally, a little bit of checking, we plot our calculated data on our chart (in blue):
lines(samples$loganswer,samples$OD, type="points", col="blue")

Note that one of my samples (0.19) didn't return a value. This is because an OD of 0.19 lies outside of the curve I calculated.

Some problems that can occur:
You are dividing by zero somewhere, move your numbers around ie take the log and add 10.
stdcrvdata$logconcplus <-stdcrvdata$logconc + 10

You are taking the square root of a negative number - for example when solving for OD's where they lie outside the curve you have generated (i.e. bottom parameter = d = 2 and you are trying to calculate the concentration when an OD = 1.9). In my example I have one of these points and the result is NaN (a complex number).

You don't have enough data points, this will cause a fail in the curve fitting.

You need to pick better seeding/starting values for parameters.

########## cross posting #########

Please feel free to cross post this solution to other forums.

IVDtools
IVDtools's picture
Hi,

Hi,

 Since your data are already in excel if find it more practicle to have the calculations in Excel. I have made an excel plugin that does four parameter logistic as well as linear, point to point, five parameter logistics second order polynomial and third order polynomail fitting. If this is not enough you can also add your own fit formula. It is specially made for ELISA and other immunoassays.You can then see for yourself what fit is the best. The program is called IVDfit and the software and a trial version can be downloaded from www.ivdtools.com.

sailor1
sailor1's picture
Hello,

Hello,

although this thread is old, I add my information because it may help someone some day:

I progarmmed a little Excel sheet that automatically optimizes the curve fit by 4 and 5 - parameter logistics.

You may dwonload the sheet here: http://home.arcor.de/dreckes/4and5PL.htm

Have fun with it !

Sailor

sailor1
sailor1's picture
Hello,

Hello,

The linear regression is a bad way to fit a standard curve as bioassays (like ELISA) nomrally have a sigmoidal curve OD vs. concentration. To fit a good standard curve 2 algorithms have been developed, the 4 parameter logistics for symmetrical curves and the 5 parameter logistics for asymmetrical curves.
Compare the goodness of curve fit of your calibration via the SSE (sum of squared errors) and you will see which model fits your curve best. Do not extrapolate outside the range of your calibrators.

You can download a free program for non-commercial use which I wrote in Excel from here :

http://rheumatologie-neuss.net/index-Dateien/RheumatologieNeuss13.htm

Instructions included.

Have fun with it,

ExcelSolverSolution

misato
misato's picture
 Hi elisa model...could I ask

 Hi elisa model...could I ask you from:
When you plot the data you can see the top of the curve which equals parameter a and the bottom is parameter d. The inflection point on the curve is parameter c and b is the degree of curvature. Use these values for seeding your parameters in the next step. Play with the equation in excel to see what changing the  numbers does.

How do you get the values?? I was able to plot the data in R (although without a line) but no idea how to get the values...specially the slope one. Could you please explain a little further?

Thanks!

elisamodel
elisamodel's picture
Hello,

Hello,

If you have plotted the raw data, you can look on the graph at the highest points, read across to the y-axis and whatever that value is, you use that as the seed value (a)
You do the same thing for the lower value, read it off the y-axis after you have plotted your data points. (d)
To find the inflection point c on the curve you look at your curve, find the spot midway between the top and bottom, and this time read down to the x-axis and whatever value that is, use it as your seed value. (cc)
The b parameter isn't obvious from the curve, I would use what's in my example (-11).
If you run the code example below (taken from my previous example), you can see where I get the numbers, on the y-axis the top and bottom are ~1.2 and 0.2, and the x-axis midpoint is about 2.1ish. In the code I used 1.5, 0.2 and 2. The parameters from the solution are a 1.3, d 0.2, cc 1.96 and b -5.2

############### Data input ###############
#input the data

stdcrvdata<-data.frame(conc=c(3,10,30,100,300,1000,3000,10000,30000), OD=c(.2,.22,.41,.75,1.07,1.18,1.2,1.27,1.29))

stdcrvdata$logconc <-log10(stdcrvdata$conc)

plot(stdcrvdata$logconc, stdcrvdata$OD, main="log standard curve", xlab="x=log(conc)", ylab="y=OD")

############### fit the data ###############
fit <- nls(OD ~ d+(a-d)/(1+(logconc/cc)^b), data=stdcrvdata, start=list(d=0.2, a=1.5, cc=2, b=-11), trace=TRUE)
summary(fit)

############### Plot the results ###############
#this lets you graph your calculated equations nice and pretty
x <- seq(.5,4.5, length=100)
y <- (coef(fit)["d"]+(coef(fit)["a"]-coef(fit)["d"])/(1+(x/coef(fit)["cc"])^coef(fit)["b"]))

lines(x,y, lty="dotted", col="red")

Rnovice
Rnovice's picture
 Hi elisamodel,

 Hi elisamodel,

I am trying to create an R program to automatically take the x and y standard curve values generated on softmax pro. I am trying to compare the fits generated by the masterplex readerfit 4PL fit and the one generated by R using your solution. However, I keep getting this error:

Error in nlsModel(formula, mf, start, wts) : 
  singular gradient matrix at initial parameter estimates 

Also, I tried using the inbuilt function LL2.4() in drc package, but the fitted coefficients are very different from the masterplex results.

Here is the starting data:

 

x1

y1

1

1500.00

439908

2

1500.00

464838

3

1500.00

467593

4

150.00

26126

5

150.00

26639

6

150.00

26524

7

25.00

3482

8

25.00

3555

9

25.00

3438

10

5.00

790

11

5.00

826

12

5.00

805

13

2.00

443

14

2.00

464

15

2.00

469

16

1.00

337

17

1.00

355

18

1.00

364

19

0.50

278

20

0.50

279

21

0.50

307

22

0.25

241

23

0.25

266

24

0.25

276

My results:

collapse;width:349pt">

Algorithm Parameter: Calc. Top

423431.8

Algorithm Parameter: Calc. Bottom

241.4827

Algorithm Parameter: Calc. MidPoint

1509.018

Algorithm Parameter: Calc. HillSlope

-1.144871

Masterplex results:

collapse;width:349pt">

Algorithm Parameter: Calc. Top
599346722.04

Algorithm Parameter: Calc. Bottom
261.459984

Algorithm Parameter: Calc. MidPoint
688156.3644

Algorithm Parameter: Calc. HillSlope
1.182274754

Resulting calculations of X from fit are also very different as a consequence. Any help will be appreciated.
 

elisamodel
elisamodel's picture
Hello Rnovice,

Hello Rnovice,

Without going into your dataset there are two things I can think about that cause "singular gradient matrix at initial parameter estimates".
1. try different initial parameter estimates. You can also tackle this by fixing one of the parameters in your model and trying to fit the rest. Do this by assigning say b an initial value, and don't include b in your start=list(). Now b is a fixed parameter.
2. the nls alogorithm fails with a perfect data set, you must have a bit of noise.

Someone gave me this note with regards to adding some noise in R. Otherwise you can manually add noise, add it in excel etc, whatever solution works easiest for you.

# the equation is y=a*x^b
# the runif() function add some noise, since nls doesn't like zero-residue models ;-)
my.x<-seq(1,10,1)
my.y<-3*my.x^2+runif(10,-10,10)

zebrafish
zebrafish's picture
 Hi elisamodel,

 Hi elisamodel,

I am trying to use your code for looking at ELISA data in r. The code works well to plot my data but when creating the model I get the error message: Error in numericDeriv(form[[3L]], names(ind), env) : 
  Missing value or an infinity produced when evaluating the model

I have selected my start values based on your suggestions but this doesn't work. Do you know why I could be getting this error?

This is my code:

stdcrvdata<-data.frame(conc=c(3,1,0.333,0.111,0.037,0.012), OD=c(0.07343681,0.18686658,0.37858933,0.62763088,0.78400863,0.95688270))

stdcrvdata$logconc <-log10(stdcrvdata$conc)

plot(stdcrvdata$logconc, stdcrvdata$OD, main="log standard curve", xlab="x=log(conc)", ylab="y=OD")
 
fit <- nls(OD ~ d+(a-d)/(1+(logconc/cc)^b), data=stdcrvdata, start=list(d=0.05, a=0.9, cc=-0.75, b=-11), trace=TRUE)

Many Thanks