runFit {ELISAtools}R Documentation

Fit 5- or 4-parameter logistic function


Fit 5- or 4-parameter logistic function to estimate the parameters by pooling the standard curves from all batches


runFit(pars, a, d, batches, refBatch.ID = 1, model = c("5pl", "4pl"))



numeric vector initial values to estimate the paramters


numeric the initial value for a (the lower limit of the function)


numeric the initial value for d (the upper limit of the function)


list of the batch data used to fit the model


numeric or string indicating the reference batch, by default is set to be the first one.


characters to indicate either 5-parameter logistic function (5pl, default one) or 4-parameter logistic (4pl) to be used in the fitting.


In this fitting, we first "guess" the initial values and then estimate the parameters based on 5- or 4-parameter function by shifting every single standard curves towards the reference line. We are reasoning that the intra-batch and inter-batch factors affect the curve similarly by shifting the curve left or right without changing its shapes. So we combine them together to to fit one single reference curve. To model the inter-batch effects, we take the average of the shifts of curves withine each batch, and use it to correct/normalize between different batches.
To summerize, each individual curve has its own shifts, which contains the information about intra- and inter-batch effects. each batch has one batch level shifts (S Factor), which is an average of shifts of curves within its batch and contains information about inter-batch effects. When we try to normalize between batches, we will apply the batch level shift to all the curves within the same batch.


the batch data with the fitted model


Feng, et al 2018 doi: 10.1101/483800


#R code to run 5-parameter logistic regression on ELISA data
#load the library

#get file folder
dir_file<-system.file("extdata", package="ELISAtools")


#make a guess for the parameters, the other two parameters a and d 
#will be estimated based on data.
pars<-c(7.2,0.5, 0.015) #5pl inits
names(pars)<-c("xmid", "scal", "g")

#do fitting. model will be written into data set.
batches<-runFit(pars=pars,  batches=batches, refBatch.ID=1, model=model  )

[Package ELISAtools version 0.1.5 Index]