aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc>2005-05-19 15:23:54 +0000
committerranke <ranke@d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc>2005-05-19 15:23:54 +0000
commit9b08a42e6eb2c35818f904b309da5632fa3eff1c (patch)
treeb5107c0a0aed1f2a6ca0918c6ea98dff5f435ea4 /R
parentb4e1ff17e3e8dfa03b8bc38f7231fa7c06d9dec9 (diff)
Added the "allWrong" argument to the drfit function for dose-response data that produce
misleading or wrong fits with all dose-response models. git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/drfit@25 d1b72e20-2ee0-0310-a1c4-ad5adbbefcdc
Diffstat (limited to 'R')
-rw-r--r--R/drfit.R11
1 files changed, 7 insertions, 4 deletions
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)))

Contact - Imprint