Scientist Solutions: International Life Science Community By Scientists For Scientists
    
Home » Forums » Immunology » Assay Development & Protocols » 4 parameter logistic fit

Thanks to our sponsors who make this site possible

4 parameter logistic fit

RSS Feed

Would you like to save this topic, event, protocol or job so you can find it again easily?

Just click the "Save to My Lab Drawer" link and the item will be saved in the My Lab Drawer section of your bench space.

Available to members only. Please log in or register for your free account now.

desmondo84
United Kingdom

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Topic Started by desmondo84
on 4/23/2009 8:28 AM   
Reply to this post Go to the top of the page

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, 


Replies
MsV
United Kingdom

Send PM
See Mini bio

Status: Tadpole
Tadpole
Posted By MsV
on 5/5/2009 5:49 AM   
Reply to this post Go to the top of the page

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
United States

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By fcs
on 7/27/2009 16:18 PM   
Reply to this post Go to the top of the page

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:

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


Last edited Jun 03, 2010, 17:33 PM by fcs

Assaywiz
United Kingdom

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By Assaywiz
on 8/2/2011 2:52 AM   
Reply to this post Go to the top of the page

Hi,

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

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

AW




Send PM
See Mini bio

Status: Frog Laureate
Frog Laureate
Posted By Rajeshwari patel
on 8/3/2011 5:54 AM   
Reply to this post Go to the top of the page

 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




Send PM
See Mini bio

Status: Sponsoring Company
Sponsoring Company
Posted By Hitachi Solutions America
on 8/3/2011 10:07 AM   
Reply to this post Go to the top of the page

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
Switzerland

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By elisamodel
on 8/29/2011 23:39 PM   
Reply to this post Go to the top of the page

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
Netherlands

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By IVDtools
on 4/16/2012 11:25 AM   
Reply to this post Go to the top of the page

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
Germany

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By sailor1
on 11/12/2012 2:22 AM   
Reply to this post Go to the top of the page

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



ExcelSolverSolution
Ashmore and Cartier Islands

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By ExcelSolverSolution
on 12/5/2012 3:40 AM   
Reply to this post Go to the top of the page

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
United Kingdom

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By misato
on 12/28/2013 20:22 PM   
Reply to this post Go to the top of the page

 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
Switzerland

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By elisamodel
on 3/3/2014 11:00 AM   
Reply to this post Go to the top of the page

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
United States

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By Rnovice
on 4/2/2014 13:51 PM   
Reply to this post Go to the top of the page

 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:
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:
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
Switzerland

Send PM
See Mini bio

Status: Frog Egg
Frog Egg
Posted By elisamodel
on 4/4/2014 7:38 AM   
Reply to this post Go to the top of the page

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)



As a Scientist Solutions member, you are able to register a positive vote for any topic which you believe is useful and relevant to our board or any reply which you believe is especially well worded and helpful.

By participating in the voting, you will be helping to identify the best topics & replies on the board.

You may vote once for any one post, and you may not vote for your own posts.

A post (topic or reply) will earn one "thumbs up" icon for every 10 votes received (up to 3 thumbs up), and the person who made the post will also earn two bonus points.

learn more about member points.