How to do 4-parametric regression for ELISA data in R I am a biology student. We do many Enzyme Linked Immunosorbent Assay (ELISA) experiments and Bradford detection. A 4-parametric logistic regression (reference) is often used for regression these data following this function:
$$
F(x) = \left(\frac{A-D}{1+(x/C)^B}\right) + D 
$$
How can I do this in R? I want to get the $A$, $B$, $C$ and $D$ values and plot the curve.
PS. If I have some data, how can I use the calculated function $F(x)$ to get the value? I mean how do I go from "data -> F(x) -> value"?
 A: The 2nd answer to a Google search for 4 parameter logistic r is this promising paper in which the authors have developed and implemented methods for analysis of assays such as ELISA in the R package drc.  Specifically, the authors have developed a function LL.4() which implements the 4 paramater logistic regression function, for use with the general dose response modeling function drm.
Christian Ritz, Jens Streiberg.  Bioassay Analysis Using R.  Journal of Statistical Software, 2005, Vol. 12, No. 5.
Ritz et al have published a new paper that covers improvements to the 'drc' R package.
Dose Response Analysis using R (PLOS ONE, 2015)
A: 
After days, I record my found here:
http://www.bioassay.dk/index-filer/start/DraftDrcManual.pdf gives me
  the current manual of drc package in R. For example:
library(drc) model1 <- drm(SLOPE~DOSE, CURVE,
  fct=LL.4(names=c("Slope", "Lower", "Upper", "ED50")),data=spinach)
  summary(model1) plot(model1) 
  If I wanna predict the dose from
  observation.
model2 <- drm(DOSE~SLOPE, CURVE, fct=LL.4(names=c("Slope", "Lower",
  "Upper", "ED50")),data=spinach) predict(model2, newdata,
  type="response") newdata is a dataframe

'predict' is not the best way to estimate the DOSE from SLOPE in this case, because you have to reverse them in your model2, which doesn't work in this example. 
If you want to estimate the DOSE from SLOPE, or 'Concentration' from 'OD' in case of an ELISA, just use the ED function of the 'drc' package
EXAMPLE:
library(drc)
model1 <- drm(SLOPE~DOSE, CURVE, 
              fct=LL.4(names=c("Slope", "Lower", "Upper", "ED50")),data=spinach)
plot(model1)

# the ED function is used to give the EDx value. For example, the ED50 is the 
# DOSE value for the 50% response
ED(model1,50)

# check ?ED
?ED

# The result is a matrix, from which the Estimate values can be extracted using
# the index (display=F is a good option also) 
ED(model1,50,display=F)[1:5]

# type="absolute" gives you the ability to use absolute values for the response, to 
# estimate the DOSE
response<-0.5   #lets use 0.5 for the response
DOSEx<-ED(model1,response,type="absolute",display=F)[1:5] # the estimated DOSE
points(y=rep(response,5),x=DOSEx,col="blue",pch=1:5)

A: You can find the least-square estimate of the parameters using nonlinear regression.  Example:
f=function(B,x)
  (B[1]-B[4])/(1+(x/B[3])^B[2])+B[4]

LS=function(B,y,x)
  sum((y-f(B,x))^2)

x=runif(100,0,5)
B=c(1,5,2.5,5)

y=f(B,x)
plot(x,y)

### Estimate should be very close to B
nlm(LS,c(1,1,1,1),x=x,y=y)

A: After days, I record my found here:
http://www.bioassay.dk/index-filer/start/DraftDrcManual.pdf gives me the current manual of drc package in R. For example:
library(drc)
model1 <- drm(SLOPE~DOSE, CURVE, fct=LL.4(names=c("Slope", "Lower", "Upper", "ED50")),data=spinach)
summary(model1)
plot(model1)

If I wanna predict the dose from observation.
model2 <- drm(DOSE~SLOPE, CURVE, fct=LL.4(names=c("Slope", "Lower", "Upper", "ED50")),data=spinach)
predict(model2, newdata, type="response")

newdata is a dataframe
If I wanna check the regression, R square is not good for nonlinear regression
RSD <- abs(sqrt(summary(model1)$"resVar") / mean(fitted(model1)))

Thanks for Christian Ritz and my father's help.
A: For what it's worth, below is an example comparing drc::drm() and gnlm::gnlr():
library(drc)
spinach1 <- subset(spinach, CURVE==1)
model.drm <- drm(SLOPE~DOSE, CURVE,
              fct=LL.4(names=c("B", "D", "A","C")),data=spinach1)
summary(model.drm)


library(gnlm)
attach(spinach1)
model.gnlr <- gnlr(y = SLOPE, 
                   mu =~ (A-D)/(1+(DOSE/C)^B) + D,
                   pmu = list(A=0.1,B=0.1,C=0.1,D=0.1),
                   pshape=log(0.05))
model.gnlr

