Skip to content

Dose-response Curves & EC50

A dose-response experiment treats cells with a dilution series of a compound and asks at which concentration the response is half gone. That concentration, the EC50, or IC50 for an inhibitor, is the usual measure of potency. This page fits four-parameter logistic curves to the viability of cells under two compounds, puts an interval on each EC50, and shows what happens to that interval when a curve stops before its lower plateau.

The four-parameter logistic curve, the 4PL, describes viability that falls from an upper plateau to a lower one:

viability = bottom + (top - bottom) / (1 + (conc / ec50)^hill)

Each parameter has a place on a plot with a log concentration axis.

  • top is the plateau at low concentration. For viability in percent of vehicle it sits near 100 when the normalization worked.
  • bottom is the plateau at high concentration, the signal that the compound cannot remove. It is zero only if the compound kills every cell.
  • ec50 is the concentration at which the curve is halfway between top and bottom. A change in ec50 slides the whole curve left or right.
  • hill is the steepness at that midpoint. With a Hill slope of 1, the fall from 90% to 10% of the span takes an 81-fold range of concentration. With a slope of 2 it takes a 9-fold range.

The ELISA standard curve page fits the same equation to calibrate an assay, and reads concentrations back from it. Here the parameters themselves are the result.

Download viability_dose_response.csv into your working directory. The invented table has 54 rows, one per well, and four columns: compound, plate, conc_um, and viability_pct. Two compounds were tested at nine concentrations from 0.01 to 100 µM in half-log steps, on three plates. Each plate was a separate experiment with its own cells and its own dilution series, and viability is in percent of the vehicle wells of the same plate.

The values come from 4PL curves with known parameters, plus independent noise with a standard deviation of 4 points on every well.

Compound Top Bottom EC50 (µM) Hill slope
Compound A 100 5 0.5 1.2
Compound B 100 20 25 1.0

Compound B is 50 times less potent, and its true curve is at 36% and still falling at 100 µM, the highest concentration tested.

library(drc)
library(ggplot2)
viability <- read.csv("viability_dose_response.csv")
dir.create("outputs", showWarnings = FALSE)
compound_a <- viability[viability$compound == "Compound A", ]
compound_b <- viability[viability$compound == "Compound B", ]
level_means <- tapply(viability$viability_pct,
list(viability$conc_um, viability$compound), mean)
cat(sprintf("%d wells, mean viability at each concentration\n",
nrow(viability)))
cat(sprintf("%-10s %s\n", "conc_um",
paste(sprintf("%6s", rownames(level_means)), collapse = "")))
for (compound in colnames(level_means)) {
cat(sprintf("%-10s %s\n", compound,
paste(sprintf("%6.1f", level_means[, compound]),
collapse = "")))
}
54 wells, mean viability at each concentration
conc_um 0.01 0.03 0.1 0.3 1 3 10 30 100
Compound A 98.1 93.1 85.8 67.1 34.8 18.2 8.4 5.5 8.6
Compound B 99.7 97.2 97.0 103.2 101.2 94.6 77.5 58.2 36.4

Compound A falls from 98.1% at 0.01 µM to a floor between 5% and 9% at its last three concentrations, so its row shows both plateaus. Compound B stays above 94% up to 3 µM and has only its last three concentrations on the slope, at 77.5%, 58.2% and 36.4%. Nothing in its row shows where the fall ends.

Both tools fit on the concentration scale. Give them the concentration as measured, and keep the logarithm for the plot axis.

In R, drm() from drc fits the model named in fct. LL.4() is the 4PL, and its names argument renames the drc parameters b, c, d, e to the four names above. The default search of drc stops with the fourth digit still loose, so drmc(relTol = 1e-12) tightens it.

In Python, curve_fit() from SciPy takes a model function whose first argument is the concentration. It also needs a starting value for each parameter: here a Hill slope of 1, the lowest and highest viability for the plateaus, and the geometric middle of the tested range for the EC50. The lower bounds keep the Hill slope and the EC50 positive. A curve with a negative Hill slope and the two plateaus exchanged is the same curve, and the bound stops the search from returning that labeling.

parameter_names <- c("hill", "bottom", "top", "ec50")
tight <- drmc(relTol = 1e-12)
fit_a <- drm(viability_pct ~ conc_um, data = compound_a,
fct = LL.4(names = parameter_names), control = tight)
fit_b <- drm(viability_pct ~ conc_um, data = compound_b,
fct = LL.4(names = parameter_names), control = tight)
fits <- list("Compound A" = fit_a, "Compound B" = fit_b)
for (label in names(fits)) {
fit <- fits[[label]]
errors <- sqrt(diag(vcov(fit)))
cat(sprintf("%s: residual SE %.2f on %d df\n", label,
summary(fit)$rseMat[1, "rse"], df.residual(fit)))
for (index in seq_along(parameter_names)) {
cat(sprintf(" %-6s %8.4g SE %.3g\n", parameter_names[index],
coef(fit)[index], errors[index]))
}
}
Compound A: residual SE 2.85 on 23 df
hill 1.161 SE 0.0774
bottom 6.413 SE 1.11
top 97.73 SE 1.47
ec50 0.5228 SE 0.0331
Compound B: residual SE 3.45 on 23 df
hill 1.204 SE 0.158
bottom 26.56 SE 5.9
top 99.99 SE 0.944
ec50 22.21 SE 4.19

The estimates agree between R and Python to the four digits printed. Compound A recovers its truth within two standard errors on every parameter: a Hill slope of 1.161 against 1.2, a bottom of 6.413 against 5, a top of 97.73 against 100, and an EC50 of 0.5228 µM against 0.5.

Compound B is less settled. Its top, 99.99, is more precise than that of Compound A, because six concentrations sit on the upper plateau. Its bottom is 26.56 with a standard error near 6, against a truth of 20, and its EC50 is 22.21 µM with a standard error above 4, against a truth of 25. No well measured the lower plateau, so the fit extrapolates it, and the EC50 is the halfway point to that extrapolated value.

The standard errors differ between the tabs, by about 1% for Compound A and by up to 16% for Compound B, where the Hill slope has 0.158 in R and 0.184 in Python. drc inverts the full matrix of second derivatives of the residual sum of squares. curve_fit() builds its covariance from the first derivatives of the model alone, the Jacobian. The two matrices are equal for a model that is linear in its parameters, and they move apart as a curve gets harder to determine. Both are large-sample approximations, so a visible gap between them is a sign that the data hold the curve loosely.

Draw the wells, the two fitted curves, and a dashed line at each EC50, on a log concentration axis.

grid <- data.frame(conc_um = 10^seq(-2, 2, length.out = 200))
curves <- rbind(
data.frame(compound = "Compound A", conc_um = grid$conc_um,
viability_pct = predict(fit_a, newdata = grid)),
data.frame(compound = "Compound B", conc_um = grid$conc_um,
viability_pct = predict(fit_b, newdata = grid)))
midpoints <- data.frame(compound = c("Compound A", "Compound B"),
ec50 = c(coef(fit_a)[4], coef(fit_b)[4]))
curve_plot <- ggplot(viability,
aes(conc_um, viability_pct, color = compound)) +
geom_vline(data = midpoints, aes(xintercept = ec50, color = compound),
linetype = "dashed") +
geom_line(data = curves, linewidth = 0.8) +
geom_point(alpha = 0.7, size = 2) +
scale_x_log10(breaks = c(0.01, 0.1, 1, 10, 100),
labels = c("0.01", "0.1", "1", "10", "100")) +
scale_color_manual(values = c("#1f4e5f", "#d95f02"), name = NULL) +
labs(x = "Concentration (µM, log scale)",
y = "Viability (% of vehicle)") +
theme_classic(base_size = 12) +
theme(legend.position = "top")
ggsave("outputs/dose-response-curves-r.png", curve_plot, width = 6,
height = 4, dpi = 150)

Viability against concentration on a log axis for two compounds, drawn with ggplot2. The curve of Compound A falls from 98% to 6% with a dashed line at its EC50 of 0.52 µM. The curve of Compound B stays near 100% up to 3 µM and is still falling at 100 µM, the last concentration, where the wells read about 36%. Its dashed line is at 22 µM.

The dashed line of Compound A crosses a fall that the wells trace from one plateau to the other. The dashed line of Compound B stands at 22 µM, and it marks the middle of a fall that the wells do not finish. The last wells read about 36%, and the fitted bottom of 26.56 lies below every well of this compound.

The EC50 is one of the four parameters, so its simplest interval is the estimate plus or minus a t quantile times its standard error, here with 23 residual degrees of freedom. ED() in drc calls this the delta interval, and the Python tab computes the same formula from the curve_fit() covariance. The interval is symmetric on the concentration scale, and for a poorly determined EC50 its lower limit can fall below zero.

The second interval is symmetric on the log scale. It takes SE / EC50 as the standard error of log EC50 and exponentiates the limits, so both stay positive. In drc this is interval = "tfls".

for (label in names(fits)) {
delta <- ED(fits[[label]], 50, interval = "delta", display = FALSE)
log_scale <- ED(fits[[label]], 50, interval = "tfls", display = FALSE)
cat(sprintf("%s: EC50 %.4g uM, SE %.3g\n", label, delta[1, "Estimate"],
delta[1, "Std. Error"]))
cat(sprintf(" delta 95%% CI [%.4g, %.4g]\n", delta[1, "Lower"],
delta[1, "Upper"]))
cat(sprintf(" log scale 95%% CI [%.4g, %.4g], upper / lower = %.2f\n",
log_scale[1, "Lower"], log_scale[1, "Upper"],
log_scale[1, "Upper"] / log_scale[1, "Lower"]))
}
Compound A: EC50 0.5228 uM, SE 0.0331
delta 95% CI [0.4542, 0.5913]
log scale 95% CI [0.4585, 0.596], upper / lower = 1.30
Compound B: EC50 22.21 uM, SE 4.19
delta 95% CI [13.55, 30.88]
log scale 95% CI [15.04, 32.81], upper / lower = 2.18

For Compound A the two intervals nearly coincide, 0.4542 to 0.5913 µM and 0.4585 to 0.596 µM in R, and both contain the true 0.5. The upper limit is 1.30 times the lower one.

For Compound B the R delta interval runs from 13.55 to 30.88 µM and the log-scale interval from 15.04 to 32.81 µM, an upper limit 2.18 times the lower one. Python prints 13.36 to 31.06 and 14.91 to 33.08, wider because of its larger standard error. The two compounds have the same number of wells and the same noise, yet the standard error is 6% of the EC50 for Compound A and 19% for Compound B. The missing lower plateau costs that precision.

One option of ED() needs care. interval = "fls" exponentiates the estimate and its limits, which is correct for a model that estimates log EC50, such as LL2.4(). On an LL.4() fit it returns exp(EC50) without a warning.

The EC50 above is the relative EC50, the concentration halfway between the fitted top and the fitted bottom. The absolute EC50, usually written IC50 for an inhibitor, is the concentration at which viability crosses 50% of the vehicle control, wherever the plateaus are. The two are equal for a curve that runs from 100 to 0, and they separate as the bottom rises. A compound with a bottom above 50% has no absolute IC50.

In R, ED() with type = "absolute" returns the crossing. interval = "inv" takes its limits from the confidence band of the fitted curve, at the two concentrations where the band crosses 50%. In Python the crossing has a closed form, and the delta method gives its standard error from the gradient of that form and the covariance of all four parameters.

for (label in names(fits)) {
fit <- fits[[label]]
relative <- ED(fit, 50, display = FALSE)
inverse <- ED(fit, 50, type = "absolute", interval = "inv",
display = FALSE)
delta <- ED(fit, 50, type = "absolute", interval = "delta",
display = FALSE)
cat(sprintf("%s\n", label))
cat(sprintf(" relative EC50 %.4g uM, where viability is %.1f%%\n",
relative[1, "Estimate"], (coef(fit)[2] + coef(fit)[3]) / 2))
cat(sprintf(" absolute IC50 %.4g uM, where viability is 50%%\n",
inverse[1, "Estimate"]))
cat(sprintf(" inverse regression 95%% CI [%.4g, %.4g]\n",
inverse[1, "Lower"], inverse[1, "Upper"]))
cat(sprintf(" delta option of ED(): SE %.3g, 95%% CI [%.4g, %.4g]\n",
delta[1, "Std. Error"], delta[1, "Lower"], delta[1, "Upper"]))
cat(sprintf(" absolute / relative = %.2f\n",
inverse[1, "Estimate"] / relative[1, "Estimate"]))
}
Compound A
relative EC50 0.5228 uM, where viability is 52.1%
absolute IC50 0.5653 uM, where viability is 50%
inverse regression 95% CI [0.5132, 0.6227]
delta option of ED(): SE 0.0356, 95% CI [0.4916, 0.639]
absolute / relative = 1.08
Compound B
relative EC50 22.21 uM, where viability is 63.3%
absolute IC50 41.67 uM, where viability is 50%
inverse regression 95% CI [34.59, 49.98]
delta option of ED(): SE 10.7, 95% CI [19.55, 63.79]
absolute / relative = 1.88

For Compound A the two definitions give 0.5228 and 0.5653 µM, a factor of 1.08, because its curve runs almost from 100 to 0. For Compound B they give 22.21 and 41.67 µM, a factor of 1.88. The relative EC50 marks a viability of 63.3%, halfway to a bottom that no well observed. The absolute IC50 marks 50%, and the true curve of Compound B also crosses 50% at 41.67 µM.

The absolute IC50 of Compound B is also the better determined of the two. Its interval is 34.59 to 49.98 µM by inverse regression and 33.63 to 49.7 µM by the delta method in Python, an upper limit less than 1.5 times the lower one, against 2.18 for the relative EC50. The wells at 30 and 100 µM bracket the 50% crossing, while the relative EC50 depends on a plateau beyond the data.

Do not take the interval of an absolute level from interval = "delta" in drc 4.0-0. For Compound B it reports a standard error of 10.7 µM and limits of 19.55 to 63.79 µM, where the delta method over all four parameters gives a standard error of 3.88.

Say which definition you report. Sebaugh (2011) recommends the relative EC50 only when at least two concentrations lie beyond each bend of the curve, and the absolute one only when two concentrations have a predicted viability below 50% and two above. Compound B has one concentration below 50%, so by that guideline it needs a higher top concentration before either number is reported.

The potency ratio is the EC50 of one compound divided by the EC50 of the other. For its interval, drc needs both curves in one model: curveid = compound fits four parameters per compound with one shared residual variance. EDcomp() then returns the ratio of the two 50% levels with a delta interval, and reverse = TRUE puts Compound B in the numerator.

SciPy has no such function, so the Python tab applies the delta method to the two separate fits. The fits share no data, so the squared relative standard errors of the two EC50 values add.

joint <- drm(viability_pct ~ conc_um, curveid = compound, data = viability,
fct = LL.4(names = parameter_names), control = tight)
ratio <- EDcomp(joint, c(50, 50), interval = "delta", reverse = TRUE,
display = FALSE)
cat(sprintf("EC50 of Compound B / EC50 of Compound A = %.2f\n",
ratio[1, "Estimate"]))
cat(sprintf("95%% CI [%.2f, %.2f], residual df %d\n", ratio[1, "Lower"],
ratio[1, "Upper"], df.residual(joint)))
absolute_a <- ED(fit_a, 50, type = "absolute", display = FALSE)
absolute_b <- ED(fit_b, 50, type = "absolute", display = FALSE)
cat(sprintf("Ratio of the absolute IC50 values = %.1f\n",
absolute_b[1, "Estimate"] / absolute_a[1, "Estimate"]))
EC50 of Compound B / EC50 of Compound A = 42.49
95% CI [26.52, 58.46], residual df 46
Ratio of the absolute IC50 values = 73.7

Compound B needs 42.49 times the concentration of Compound A to reach its own midpoint. R puts the interval at 26.52 to 58.46 and Python at 25.15 to 59.83, and both contain the true ratio of 50. The estimate is the same in both tabs. The limits differ because drc pools the residual variance of the two curves and takes its standard errors from second derivatives, as in the fit above.

One ratio describes a pair of compounds only when the two curves have the same shape and differ by a shift along the log axis. Here the Hill slopes are close, 1.161 and 1.204, but the bottoms are 6.413 and 26.56, so the two midpoints sit at different viabilities, 52.1% and 63.3%. The ratio of the absolute IC50 values compares the two compounds at the same 50% viability, and it is 73.7. State which ratio you report.

Every concentration has three wells, so the curve through the nine means of Compound B is the same curve as the one through its 27 wells. The uncertainty is not the same.

means_b <- aggregate(viability_pct ~ conc_um, data = compound_b,
FUN = mean)
fit_means <- drm(viability_pct ~ conc_um, data = means_b,
fct = LL.4(names = parameter_names), control = tight)
compared <- list("27 wells:" = fit_b, "9 means: " = fit_means)
for (label in names(compared)) {
ec50 <- ED(compared[[label]], 50, interval = "delta", display = FALSE)
cat(sprintf("%s EC50 %.4g, SE %.3g, %d df, 95%% CI [%.4g, %.4g]\n",
label, ec50[1, "Estimate"], ec50[1, "Std. Error"],
df.residual(compared[[label]]), ec50[1, "Lower"],
ec50[1, "Upper"]))
}
27 wells: EC50 22.21, SE 4.19, 23 df, 95% CI [13.55, 30.88]
9 means: EC50 22.21, SE 6.34, 5 df, 95% CI [5.927, 38.5]

Both fits return an EC50 of 22.21 µM. The fit to 27 wells estimates the noise from 23 residual degrees of freedom. The fit to 9 means has 5, and it no longer sees the scatter between replicate wells: its only evidence of noise is the distance of nine means from a curve with four parameters. In R the standard error rises from 4.19 to 6.34 and the interval widens from 13.55 to 30.88 µM to 5.927 to 38.5 µM. In another table the nine means can lie close to the curve by chance, and the interval then comes out too narrow. Fit the wells when the wells are independent.

The opposite mistake counts wells that are not independent. If the three wells of a concentration shared one plate, one cell suspension, and one dilution series, they would measure pipetting and reader noise, and the 23 degrees of freedom would describe a single experiment. The interval would be too narrow for a claim about the compound. Average such wells within the plate, fit one curve per plate, and summarize the log EC50 values of the independent plates, or add a plate term as in mixed models.

A 4PL fit returns an EC50 for any table, also when the curve has hardly begun to fall. An estimate above the highest tested concentration extrapolates the slope and the bottom together. Report such a compound as “EC50 above 100 µM” and test higher concentrations. The ELISA standard curve page shows the same failure in a calibration curve, where the fitted midpoint of 4,283 pg/mL lies beyond the top standard of 3,000 pg/mL.

Without p0, curve_fit() starts every parameter at 1. That start reaches the right curve for this table in µM. The same concentrations in nM put the EC50 near 22,000, far from 1, and the default start fails for Compound B.

conc_nm = compound_b["conc_um"].to_numpy() * 1000.0
response_b = compound_b["viability_pct"].to_numpy()
careless, _ = optimize.curve_fit(four_parameter_logistic, conc_nm,
response_b)
start_nm = [1.0, response_b.min(), response_b.max(),
np.sqrt(conc_nm.min() * conc_nm.max())]
careful, _ = optimize.curve_fit(
four_parameter_logistic, conc_nm, response_b, p0=start_nm,
bounds=([0.0, -np.inf, -np.inf, 0.0], np.inf))
for label, estimates in (("default start:", careless),
("start from data:", careful)):
fitted = four_parameter_logistic(conc_nm, *estimates)
print(f"{label:<17} hill {estimates[0]:.4g}, "
f"bottom {estimates[1]:.4g}, top {estimates[2]:.4g}, "
f"ec50 {estimates[3]:.0f} nM, "
f"RSS {np.sum((response_b - fitted)**2):.0f}")
default start: hill 0.001457, bottom -8225, top 8397, ec50 807 nM, RSS 4383
start from data: hill 1.204, bottom 26.56, top 99.99, ec50 22212 nM, RSS 273

The default start ends at a Hill slope of 0.001457, a bottom of -8225 and a top of 8397, with a residual sum of squares of 4383 against 273 for the correct curve. SciPy raises no error. The only signal is a NumPy warning, “invalid value encountered in power”, which appears when the search tries a negative EC50. Starting values taken from the data, with the two lower bounds, return the curve of the earlier fit with the EC50 at 22212 nM.

drc does not need this step, because LL.4() carries a self-starter that derives starting values from the data.

Give the model, the definition of the EC50, the estimate with its interval, the Hill slope, the number of independent experiments, and the software: “Compound A reduced viability with a relative EC50 of 0.52 µM (95% CI 0.45 to 0.59 µM; Hill slope 1.16; four-parameter logistic fit to 27 wells from three independent plates, drc 4.0-0).” For Compound B, state that viability was still falling at 100 µM, the highest concentration tested. If a number is needed before the experiment is repeated with higher concentrations, the absolute IC50 of 41.67 µM, with its interval of 34.59 to 49.98 µM, is the one that the wells bracket.

The drc package by Ritz and Streibig fits dose-response models in R.

Ritz and colleagues, 2015 describe dose-response analysis in R with the drc package.

Sebaugh, 2011 defines the relative and the absolute EC50 and gives the minimum conditions for reporting each one.

The drc reference manual documents drm(), ED() and EDcomp(), and it lists the other model functions, such as the three-parameter LL.3() that fixes the bottom at zero.

The SciPy curve_fit reference explains p0, bounds, and how the returned covariance matrix is scaled by the residual variance.

The ELISA standard curve page uses the same curve for calibration, compares it with the five-parameter model, and reads sample concentrations back from it.

The Bootstrap Intervals & Permutation Tests page shows the resampling route to an interval, which applies to an EC50 when the plates are resampled as whole units.