aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DESCRIPTION4
-rw-r--r--R/drfit.R11
-rw-r--r--man/drfit.Rd5
3 files changed, 13 insertions, 7 deletions
diff --git a/DESCRIPTION b/DESCRIPTION
index 879d5b8..d082ff6 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: drfit
-Version: 0.03-24
-Date: 2005-04-27
+Version: 0.03-25
+Date: 2005-05-19
Title: Dose-response data evaluation
Author: Johannes Ranke <jranke@uni-bremen.de>
Maintainer: Johannes Ranke <jranke@uni-bremen.de>
diff --git a/R/drfit.R b/R/drfit.R
index da5b34d..ff19cca 100644
--- a/R/drfit.R
+++ b/R/drfit.R
@@ -38,7 +38,7 @@ linearlogisf <- function(x,k,f,mu,b)
drfit <- function(data, startlogEC50 = NA, chooseone=TRUE,
lognorm = TRUE, logis = FALSE,
- linearlogis = FALSE, linearlogisWrong = NA,
+ linearlogis = FALSE, linearlogisWrong = NA, allWrong = NA,
b0 = 2, f0 = 0)
{
if(!is.null(data$ok)) data <- subset(data,ok!="no fit")
@@ -84,7 +84,8 @@ drfit <- function(data, startlogEC50 = NA, chooseone=TRUE,
inactive <- FALSE
if (linearlogis &&
- length(subset(linearlogisWrong,linearlogisWrong == i))==0) {
+ length(subset(linearlogisWrong,linearlogisWrong == i))==0 &&
+ length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ linearlogisf(dose,1,f,logEC50,b),
data=tmp,
start=list(f=f0,logEC50=startlogEC50[[i]],b=b0)))
@@ -113,7 +114,8 @@ drfit <- function(data, startlogEC50 = NA, chooseone=TRUE,
}
}
- if (logis) {
+ if (logis &&
+ length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ plogis(-log10(dose),-logEC50,slope),
data=tmp,
start=list(logEC50=startlogEC50[[i]],slope=1)))
@@ -143,7 +145,8 @@ drfit <- function(data, startlogEC50 = NA, chooseone=TRUE,
}
}
- if (lognorm) {
+ if (lognorm &&
+ length(subset(allWrong,allWrong == i))==0) {
m <- try(nls(response ~ pnorm(-log10(dose),-logEC50,slope),
data=tmp,
start=list(logEC50=startlogEC50[[i]],slope=1)))
diff --git a/man/drfit.Rd b/man/drfit.Rd
index 42bbd07..2ec4a73 100644
--- a/man/drfit.Rd
+++ b/man/drfit.Rd
@@ -7,7 +7,7 @@
}
\usage{
drfit(data, startlogEC50 = NA, chooseone = TRUE, lognorm = TRUE, logis = FALSE,
- linearlogis = FALSE, linearlogisWrong = NA, b0 = 2, f0 = 0)
+ linearlogis = FALSE, linearlogisWrong = NA, allWrong = NA, b0 = 2, f0 = 0)
}
\arguments{
\item{data}{
@@ -38,6 +38,9 @@
\item{linearlogisWrong}{
An optional vector containing the names of the substances for which the
linearlogis function produces a wrong fit.}
+ \item{allWrong}{
+ An optional vector containing the names of the substances for which all
+ functions produces a wrong fit.}
\item{chooseone}{
If TRUE (default), the models are tried in the order linearlogis, logis and lognorm,
and the first model that produces a valid fit is used. Usually this will be the one

Contact - Imprint