Title: Use R package drc to fit a 4-parameter or 5-parameter dose-response curve with/without contraints"

Author: Xiaoyu Jiang

Date: Aug 25, 2015

Set environment; load data; look at data

rm(list=ls())
sessionInfo()
## R version 3.1.3 (2015-03-09)
## Platform: x86_64-apple-darwin13.4.0 (64-bit)
## Running under: OS X 10.10.2 (Yosemite)
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## loaded via a namespace (and not attached):
## [1] digest_0.6.8    evaluate_0.5.5  formatR_1.1     htmltools_0.2.6
## [5] knitr_1.9       rmarkdown_0.7   stringr_0.6.2   tools_3.1.3
library(drc)
## Loading required package: MASS
## 
## 'drc' has been loaded.
## 
## Please cite R and 'drc' if used for a publication,
## for references type 'citation()' and 'citation('drc')'.
## 
## 
## Attaching package: 'drc'
## 
## The following objects are masked from 'package:stats':
## 
##     gaussian, getInitial
data = read.table("data.txt", header=T, sep="\t")
colnames(data) = c("Conc.uM", "log.Conc", "Pctrl")

plot(data$Conc.uM, data$Pctrl, 
     main="With original concentration", xlab="Concentration (uM)", ylab="% control", col="deeppink", pch=16)

plot(data$log.Conc, data$Pctrl, 
     main="With log concentration", xlab="Log concentration", ylab="% control", col="skyblue4", pch=16)

Fit a 4-parameter model with no constrain

m.4para = drm(Pctrl ~ Conc.uM, data = data, fct = L.4())
summary(m.4para)
## 
## Model fitted: Logistic (ED50 as parameter) (4 parms)
## 
## Parameter estimates:
## 
##                  Estimate  Std. Error     t-value p-value
## b:(Intercept)     0.20039     0.13733     1.45923  0.1600
## c:(Intercept)    60.85553     9.78833     6.21715  0.0000
## d:(Intercept)  2211.93745 18930.03234     0.11685  0.9081
## e:(Intercept)   -17.04595    48.86227    -0.34886  0.7308
## 
## Residual standard error:
## 
##  23.63569 (20 degrees of freedom)
plot(m.4para, 
     main="4-parameter; no contraints", 
     xlab="Concentration (uM)", ylab="% control", 
     col="blue", pch=16)

Fit a 5-parameter model with no constrain

m.5para = drm(Pctrl ~ Conc.uM, data = data, fct = L.5())
summary(m.5para)
## 
## Model fitted: Generalised logistic (ED50 as parameter) (5 parms)
## 
## Parameter estimates:
## 
##                  Estimate  Std. Error     t-value p-value
## b:(Intercept)  2.7982e-01  1.1251e+00  2.4872e-01  0.8062
## c:(Intercept)  6.0848e+01  1.0227e+01  5.9497e+00  0.0000
## d:(Intercept)  1.4981e+03  1.6639e+04  9.0034e-02  0.9292
## e:(Intercept) -1.5341e+01  6.1116e+01 -2.5102e-01  0.8045
## f:(Intercept)  7.0695e-01  2.9737e+00  2.3774e-01  0.8146
## 
## Residual standard error:
## 
##  24.24578 (19 degrees of freedom)
plot(m.5para, main="5-parameter; no contraints", 
     xlab="Concentration (uM)", ylab="% control", 
     col="forestgreen", pch=16)

Fit a 4-parameter model with \(1000 \leq d \leq 2000\) and \(-17 \leq e \leq -1\)

m.4para.c1 = drm(Pctrl ~ Conc.uM, data = data, fct = L.4(), 
              lowerl=c(NA, NA, 1000, -17), upperl=c(NA, NA, 2000, -1))
summary(m.4para.c1)
## 
## Model fitted: Logistic (ED50 as parameter) (4 parms)
## 
## Parameter estimates:
## 
##                  Estimate  Std. Error     t-value p-value
## b:(Intercept)     0.20040     0.13820     1.45009  0.1625
## c:(Intercept)    60.84418     9.78854     6.21586  0.0000
## d:(Intercept)  2000.00000 17286.80376     0.11570  0.9090
## e:(Intercept)   -16.51015    49.80715    -0.33148  0.7437
## 
## Residual standard error:
## 
##  23.6364 (20 degrees of freedom)
plot(m.4para.c1, main="5-parameter; with contraints", 
     xlab="Concentration (uM)", ylab="% control", 
     col="orangered", pch=16)

Fit a 5-parameter model with \(1000 \leq d \leq 2000\) and \(-17 \leq e \leq -1\) and \(0 \leq f \leq 1\)

m.5para.c2 = drm(Pctrl ~ Conc.uM, data = data, fct = L.5(), 
              lowerl=c(NA, NA, 1000, -17, 0), upperl=c(NA, NA, 2000, -1, 1))
summary(m.5para.c2)
## 
## Model fitted: Generalised logistic (ED50 as parameter) (5 parms)
## 
## Parameter estimates:
## 
##                 Estimate Std. Error    t-value p-value
## b:(Intercept)    0.20649    1.71916    0.12011  0.9057
## c:(Intercept)   60.93540   11.40411    5.34328  0.0000
## d:(Intercept) 1002.85624 6149.57967    0.16308  0.8722
## e:(Intercept)  -12.34579   35.26101   -0.35013  0.7301
## f:(Intercept)    1.00000    9.90861    0.10092  0.9207
## 
## Residual standard error:
## 
##  24.2586 (19 degrees of freedom)
plot(m.5para.c2, main="5-parameter; with contraints", 
     xlab="Concentration (uM)", ylab="% control", 
     col="royalblue", pch=16)