diff options
-rw-r--r-- | R/drfit.R | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -34,7 +34,6 @@ drdata <- function(substances, experimentator = "%", db = "cytotox", odbcClose(channel) names(data)[[1]] <- "dose" names(data)[[2]] <- "response" - data$dosefactor <- factor(data$dose) data$substance <- factor(data$substance,levels=substances) return(data) } @@ -308,9 +307,9 @@ drplot <- function(drresults, data, nonzerodata$substance <- factor(nonzerodata$substance) # Get rid of pseudo substance names of controls zerodata <- subset(data,dose==0) nc <- length(zerodata$dose) # Number of control points - sdc <- sd(zerodata$response) # Standard deviation of control responses - controlconf <- sdc * qt((1 + alpha)/2, nc - 1) / sqrt(nc) if (nc > 0) { + sdc <- sd(zerodata$response) # Standard deviation of control responses + controlconf <- sdc * qt((1 + alpha)/2, nc - 1) / sqrt(nc) cat("There are ",nc,"data points with dose 0 (control values)\n") cat("with a standard deviation of",sdc,"\n") cat("and a confidence interval of",controlconf,"\n") |