drc

drc: Error in drm when used interaction terms

流过昼夜 提交于 2019-12-24 17:11:48
问题 I want to fit log-logistic regression for the following data in drc R package for the combination of Temp and Variety. However, my code throws the following error Error in Temp:Variety : NA/NaN argument Code: df2 <- structure(list(Temp = c(15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 20L, 20L, 20L, 20L, 20L, 20L, 25L, 25L, 25L, 25L, 30L, 30L, 30L, 30L, 35L, 35L, 35L, 35L, 40L, 40L, 40L, 40L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 20L, 20L, 20L, 20L, 20L, 20L, 25L, 25L, 25L, 25L, 30L,

Fitting Multiple Logistic Regression with Interaction between Quantitative and Qualitative Explanatory Variables with drm function from drc package

六眼飞鱼酱① 提交于 2019-12-13 02:35:59
问题 As a follow up to this question answered by @EDi. I wonder how to fit the following glm model with drc function from drc package. GLM Code Type <- rep(x=LETTERS[1:3], each=5, times=2) Conc <- rep(rep(x=seq(from=0, to=40, by=10), times=3), 2) Rep <- factor(rep(x=1:2, each=15)) Total <- 50 Kill <- c( 10, 30, 40, 45, 38, 5, 25, 35, 40, 32, 0, 32, 38, 47, 40, 11, 33, 38, 43, 36, 4, 23, 34, 42, 34, 2, 35, 39, 46, 42 ) df <- data.frame(Type, Conc, Rep, Total, Kill) fm1 <- glm( formula = Kill/Total

Reproducing drc::plot.drc with ggplot2

ⅰ亾dé卋堺 提交于 2019-12-07 09:19:43
问题 I want to reproduce the following drc::plot.drc graphs with ggplot2 . df1 <- structure(list(TempV = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 4L,

drc:: drc plot with ggplot2

时光毁灭记忆、已成空白 提交于 2019-12-07 05:28:27
问题 I'm trying to reproduce drc plots with ggplot2 . Here is my first attempt (MWE is given below). However, my ggplot2 is little bit different from base R plot. I wonder if I am missing something here? library(drc) chickweed.m1 <- drm(count~start+end, data = chickweed, fct = LL.3(), type = "event") plot(chickweed.m1, xlab = "Time (hours)", ylab = "Proportion germinated", xlim=c(0, 340), ylim=c(0, 0.25), log="", lwd=2, cex=1.2) library(data.table) dt1 <- data.table(chickweed) dt1Means1 <- dt1[, .

Reproducing drc::plot.drc with ggplot2

我与影子孤独终老i 提交于 2019-12-05 15:52:40
I want to reproduce the following drc::plot.drc graphs with ggplot2 . df1 <- structure(list(TempV = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 10L, 10L, 10L, 10L, 10L, 10L

drc:: drc plot with ggplot2

只愿长相守 提交于 2019-12-05 09:40:40
I'm trying to reproduce drc plots with ggplot2 . Here is my first attempt (MWE is given below). However, my ggplot2 is little bit different from base R plot. I wonder if I am missing something here? library(drc) chickweed.m1 <- drm(count~start+end, data = chickweed, fct = LL.3(), type = "event") plot(chickweed.m1, xlab = "Time (hours)", ylab = "Proportion germinated", xlim=c(0, 340), ylim=c(0, 0.25), log="", lwd=2, cex=1.2) library(data.table) dt1 <- data.table(chickweed) dt1Means1 <- dt1[, .(Germinated=mean(count)/200), by=.(start)] dt1Means2 <- dt1Means1[, .(start=start, Germinated=cumsum

Plotting dose response curves with ggplot2 and drc

对着背影说爱祢 提交于 2019-11-30 09:52:40
In biology we often want to plot dose response curves. The R package 'drc' is really useful and base graphics can easily handle 'drm models'. However, I would like to add my drm curves to a ggplot2. My dataset: library("drc") library("reshape2") library("ggplot2") demo=structure(list(X = c(0, 1e-08, 3e-08, 1e-07, 3e-07, 1e-06, 3e-06, 1e-05, 3e-05, 1e-04, 3e-04), Y1 = c(0, 1, 12, 19, 28, 32, 35, 39, NA, 39, NA), Y2 = c(0, 0, 10, 18, 30, 35, 41, 43, NA, 43, NA), Y3 = c(0, 4, 15, 22, 28, 35, 38, 44, NA, 44, NA)), .Names = c("X", "Y1", "Y2", "Y3"), class = "data.frame", row.names = c(NA, -11L ))

Plotting dose response curves with ggplot2 and drc

﹥>﹥吖頭↗ 提交于 2019-11-29 14:55:11
问题 In biology we often want to plot dose response curves. The R package 'drc' is really useful and base graphics can easily handle 'drm models'. However, I would like to add my drm curves to a ggplot2. My dataset: library("drc") library("reshape2") library("ggplot2") demo=structure(list(X = c(0, 1e-08, 3e-08, 1e-07, 3e-07, 1e-06, 3e-06, 1e-05, 3e-05, 1e-04, 3e-04), Y1 = c(0, 1, 12, 19, 28, 32, 35, 39, NA, 39, NA), Y2 = c(0, 0, 10, 18, 30, 35, 41, 43, NA, 43, NA), Y3 = c(0, 4, 15, 22, 28, 35, 38,