adding ECx estimation and interval to the model output plot
Usage
addECxCI(
p = NULL,
object,
EDres = NULL,
trend = "Decrease",
endpoint = "ErC",
respLev = c(10, 20, 50),
textAjust.x = 0.1,
textAjust.y = 0.05,
useObsCtr = FALSE,
d0 = NULL,
textsize = 2,
lineheight = 1,
xmin = 0.05,
...
)Arguments
- p
model plot as ggplot2 output
- object
fitted drc object
- EDres
EDresults corresponding to respLev
- trend
"Decrease" or "Increase"
- endpoint
ErC or EbC or EyC or EC or LD
- respLev
reponse levels
- textAjust.x
where to label ECx
- textAjust.y
where to label ECx
- useObsCtr
whether to use observed control mean
- d0
to be used control mean.
- textsize
label text size
- lineheight
errorbar height
- xmin
when confidence intervals very wide including even negative values.
- ...
additional inputs passed into ED functions.
Examples
if (FALSE) { # \dontrun{
data("dat_medium")
dat_medium <- dat_medium %>% mutate(Treatment=factor(Dose,levels=unique(Dose)))
dat_medium$Response[dat_medium$Response < 0] <- 0
mod <- drm(Response~Dose,data=dat_medium,fct=LN.4())
p1 <- plot.modList(list(mod))
addECxCI(p1,object=mod,EDres=NULL,trend="Decrease",endpoint="EC", respLev=c(10,20,50),
textAjust.x=0.01,textAjust.y=0.3,useObsCtr=FALSE,d0=NULL,textsize = 4,lineheight = 0.5,xmin=0.012)+
ylab("Response Variable [unit]") + xlab("Concentration [µg a.s./L]")
} # }