剂量-效应曲线,ED50

huangapple go评论149阅读模式
英文:

Dose-response curve, ED50

问题

I used the following code to plot the dose-response curve and display the ED50 value. However, the ED50 value was displayed at a value other than 50 on the y-axis. I used the ED function to find the ED50 value, but why am I getting these results? Is there a way to plot the graph correctly?

  1. library(drc)
  2. library(tidyverse)
  3. response_diuron <- as.numeric(c("6.666667", "10", "20", "23.33333", "100", "100"))
  4. diuron <- as.numeric(c("0", "100", "500", "1000", "5000", "10000"))
  5. df <- data.frame(diuron, response_diuron)
  6. D <- drm(response_diuron ~ diuron, data = df, fct = LL.4())
  7. newdat <- expand.grid(diuron = exp(seq(log(0.5), log(10000), length = 500)))
  8. pm <- predict(D, newdata = newdat, interval = "confidence")
  9. newdat$p <- pm[, 1]
  10. newdat$pmin <- pm[, 2]
  11. newdat$pmax <- pm[, 3]
  12. df$diuron0 <- df$diuron
  13. df$diuron0[df$diuron0 == 0] <- 0.5
  14. ed50 <- ED(D, 50, logBase = exp(1), interval = "delta")
  15. coefs <- setNames(coef(D), c("b", "c", "d", "e"))
  16. y50 <- predict(D, newdata = data.frame(diuron = coefs["e"]))
  17. ggplot(df, aes(x = diuron0, y = response_diuron)) +
  18. geom_point(shape = 21, size = 3, stroke = 1, colour = "#3C6255") +
  19. geom_line(data = newdat, aes(x = diuron, y = p), lwd = 1, color = "#3C6255") +
  20. coord_trans(x = "log") +
  21. geom_segment(aes(x = coefs["e"], y = 0, xend = coefs["e"], yend = y50),
  22. lty = 2, colour = "gray50"
  23. ) +
  24. geom_segment(aes(x = coefs["e"], y = y50, xend = 0, yend = y50),
  25. lty = 2, colour = "gray50"
  26. ) +
  27. scale_x_log10(
  28. limits = c(100, 10000), breaks = c(100, 500, 1000, 1780, 5000, 10000),
  29. labels = c(100, 500, 1000, 1780, 5000, 10000)
  30. ) +
  31. ggtitle("Diuron") +
  32. xlab("Diuron (ug/L)") +
  33. ylab("Mortality (%)") +
  34. theme(axis.text.x = element_text(angle = 90)) +
  35. theme_classic()
英文:

I used the following code to plot the dose-response curve and display the ED50 value. However, the ED50 value was displayed at a value other than 50 on the y-axis. I used the ED function to find the ED50 value, but why am I getting these results? Is there a way to plot the graph correctly?

  1. library(drc)
  2. library(tidyverse)
  3. response_diuron <- as.numeric(c("6.666667", "10", "20", "23.33333", "100", "100"))
  4. diuron <- as.numeric(c("0", "100", "500", "1000", "5000", "10000"))
  5. df <- data.frame(diuron, response_diuron)
  6. D <- drm(response_diuron ~ diuron, data = df, fct = LL.4())
  7. newdat <- expand.grid(diuron = exp(seq(log(0.5), log(10000), length = 500)))
  8. pm <- predict(D, newdata = newdat, interval = "confidence")
  9. newdat$p <- pm[, 1]
  10. newdat$pmin <- pm[, 2]
  11. newdat$pmax <- pm[, 3]
  12. df$diuron0 <- df$diuron
  13. df$diuron0[df$diuron0 == 0] <- 0.5
  14. ed50 <- ED(D, 50, logBase = exp(1), interval = "delta")
  15. coefs <- setNames(coef(D), c("b", "c", "d", "e"))
  16. y50 <- predict(D, newdata = data.frame(diuron = coefs["e"]))
  17. ggplot(df, aes(x = diuron0, y = response_diuron)) +
  18. geom_point(shape = 21, size = 3, stroke = 1, colour = "#3C6255") +
  19. geom_line(data = newdat, aes(x = diuron, y = p), lwd = 1, color = "#3C6255") +
  20. coord_trans(x = "log") +
  21. geom_segment(aes(x = coefs["e"], y = 0, xend = coefs["e"], yend = y50),
  22. lty = 2, colour = "gray50"
  23. ) +
  24. geom_segment(aes(x = coefs["e"], y = y50, xend = 0, yend = y50),
  25. lty = 2, colour = "gray50"
  26. ) +
  27. scale_x_log10(
  28. limits = c(100, 10000), breaks = c(100, 500, 1000, 1780, 5000, 10000),
  29. labels = c(100, 500, 1000, 1780, 5000, 10000)
  30. ) +
  31. ggtitle("Diuron") +
  32. xlab("Diuron (ug/L)") +
  33. ylab("Mortality (%)") +
  34. theme(axis.text.x = element_text(angle = 90)) +
  35. theme_classic()

答案1

得分: 1

I have checked your code, the parameter given in geom_segment() (both the horizontal and vertical lines) is y50, which has a value of 56.6. That's why the value is not displayed as 50 on the y-axis.

Edit 15 June 2023:

With reference to this post (https://stackoverflow.com/questions/57568882/wrong-ed50-with-dose-response-model-using-drm), I have edited your code to get the intended results. As I am not familiar with pharmacology, I am not entirely sure of what the numbers represent though, i.e., whether they really refer to the number that you are looking for that makes scientific sense.

ed50 <- ED(D, 50, type = "absolute", interval = "delta")
coefs <- setNames(ed50[1], "e")
y50 <- predict(D, newdata = data.frame(diuron = ed50))

ggplot(df, aes(x = diuron0, y = response_diuron)) +
geom_point(shape = 21, size = 3, stroke = 1, colour = "#3C6255") +
geom_line(data = newdat, aes(x = diuron, y = p), lwd = 1, color = "#3C6255") +
coord_trans(x = "log") +
geom_segment(aes(x = coefs["e"], y = 0, xend = coefs["e"], yend = y50),
lty = 2, colour = "gray50"
) +
geom_segment(aes(x = coefs["e"], y = y50, xend = 0, yend = y50),
lty = 2, colour = "gray50"
) +
scale_x_log10(
limits = c(100, 10000), breaks = c(100, 500, 1000, round(coefs["e"]), 5000, 10000),
labels = c(100, 500, 1000, round(coefs["e"]), 5000, 10000)
) +
ggtitle("Diuron") +
xlab("Diuron (ug/L)") +
ylab("Mortality (%)") +
theme(axis.text.x = element_text(angle = 90)) +
theme_classic()

英文:

I have checked your code, the parameter given in geom_segment() (both the horizontal and vertical lines) is y50, which has a value of 56.6. That's why the value is not displayed as 50 on the y-axis.

Edit 15 June 2023:

With reference to this post (https://stackoverflow.com/questions/57568882/wrong-ed50-with-dose-response-model-using-drm), I have edited your code to get the intended results. As I am not familiar with pharmacology, I am not entirely sure of what the numbers represent though, i.e., whether they really refer to the number that you are looking for that makes scientific sense.

  1. ed50 &lt;- ED(D, 50, type = &quot;absolute&quot;, interval = &quot;delta&quot;)
  2. coefs &lt;- setNames(ed50[1], &quot;e&quot;)
  3. y50 &lt;- predict(D, newdata = data.frame(diuron = ed50))
  4. ggplot(df, aes(x = diuron0, y = response_diuron)) +
  5. geom_point(shape = 21, size = 3, stroke = 1, colour = &quot;#3C6255&quot;) +
  6. geom_line(data = newdat, aes(x = diuron, y = p), lwd = 1, color = &quot;#3C6255&quot;) +
  7. coord_trans(x = &quot;log&quot;) +
  8. geom_segment(aes(x = coefs[&quot;e&quot;], y = 0, xend = coefs[&quot;e&quot;], yend = y50),
  9. lty = 2, colour = &quot;gray50&quot;
  10. ) +
  11. geom_segment(aes(x = coefs[&quot;e&quot;], y = y50, xend = 0, yend = y50),
  12. lty = 2, colour = &quot;gray50&quot;
  13. ) +
  14. scale_x_log10(
  15. limits = c(100, 10000), breaks = c(100, 500, 1000, round(coefs[&quot;e&quot;]), 5000, 10000),
  16. labels = c(100, 500, 1000, round(coefs[&quot;e&quot;]), 5000, 10000)
  17. ) +
  18. ggtitle(&quot;Diuron&quot;) +
  19. xlab(&quot;Diuron (ug/L)&quot;) +
  20. ylab(&quot;Mortality (%)&quot;) +
  21. theme(axis.text.x = element_text(angle = 90)) +
  22. theme_classic()

huangapple
  • 本文由 发表于 2023年6月13日 17:09:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76463326.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定