aboutsummaryrefslogtreecommitdiff
path: root/R/calplot.R
diff options
context:
space:
mode:
authorranke <ranke@5fad18fb-23f0-0310-ab10-e59a3bee62b4>2006-05-16 19:49:08 +0000
committerranke <ranke@5fad18fb-23f0-0310-ab10-e59a3bee62b4>2006-05-16 19:49:08 +0000
commit49eff36596275b1dbb5e07c97fb93db182baa27e (patch)
treedee5073b7ef48bee7e6fa9fc593408f2ad3d2736 /R/calplot.R
parent0973370a6e27952df81aaae2a05104195e3bf633 (diff)
- Took loq and lod apart again. lod is now an implemantation of Massart, loq is
an own variant of DIN 32645 (relative error on x axis). - Partly make functions work on models where x and y are named different from "x" and "y" (loq to be done). git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/chemCal@11 5fad18fb-23f0-0310-ab10-e59a3bee62b4
Diffstat (limited to 'R/calplot.R')
-rw-r--r--R/calplot.R11
1 files changed, 6 insertions, 5 deletions
diff --git a/R/calplot.R b/R/calplot.R
index feb9727..2deed5a 100644
--- a/R/calplot.R
+++ b/R/calplot.R
@@ -21,9 +21,10 @@ calplot.lm <- function(object, xlim = "auto", ylim = "auto",
m <- object
level <- 1 - alpha
- x <- m$model$x
- y <- m$model$y
- newdata <- data.frame(x = seq(0,max(x),length=250))
+ y <- m$model[[1]]
+ x <- m$model[[2]]
+ newdata <- list(x = seq(0,max(x),length=250))
+ names(newdata) <- names(m$model)[[2]]
pred.lim <- predict(m, newdata, interval = "prediction",level=level)
conf.lim <- predict(m, newdata, interval = "confidence",level=level)
if (xlim == "auto") xlim = c(0,max(x))
@@ -36,9 +37,9 @@ calplot.lm <- function(object, xlim = "auto", ylim = "auto",
ylim = ylim
)
points(x,y, pch = 21, bg = "yellow")
- matlines(newdata$x, pred.lim, lty = c(1, 4, 4),
+ matlines(newdata[[1]], pred.lim, lty = c(1, 4, 4),
col = c("black", "red", "red"))
- matlines(newdata$x, conf.lim, lty = c(1, 3, 3),
+ matlines(newdata[[1]], conf.lim, lty = c(1, 3, 3),
col = c("black", "green4", "green4"))
legend(min(x),

Contact - Imprint