aboutsummaryrefslogtreecommitdiff
path: root/R/drfit.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/drfit.R')
-rw-r--r--R/drfit.R5
1 files changed, 2 insertions, 3 deletions
diff --git a/R/drfit.R b/R/drfit.R
index ac3ad3e..9eee87a 100644
--- a/R/drfit.R
+++ b/R/drfit.R
@@ -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")

Contact - Imprint