aboutsummaryrefslogtreecommitdiff
path: root/R/inverse.predict.lm.R
diff options
context:
space:
mode:
authorranke <ranke@5fad18fb-23f0-0310-ab10-e59a3bee62b4>2006-05-15 23:07:31 +0000
committerranke <ranke@5fad18fb-23f0-0310-ab10-e59a3bee62b4>2006-05-15 23:07:31 +0000
commit0973370a6e27952df81aaae2a05104195e3bf633 (patch)
tree3f5dfc9238604ed6aabb1628b4bb28c2d890e8bd /R/inverse.predict.lm.R
parent88199498f148bbe31593b3109bce241c872301f6 (diff)
A trial to improve the lod function, I don't really understand
the predict.lm function unfortunately git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/chemCal@10 5fad18fb-23f0-0310-ab10-e59a3bee62b4
Diffstat (limited to 'R/inverse.predict.lm.R')
-rw-r--r--R/inverse.predict.lm.R3
1 files changed, 2 insertions, 1 deletions
diff --git a/R/inverse.predict.lm.R b/R/inverse.predict.lm.R
index b48c967..2ead9fb 100644
--- a/R/inverse.predict.lm.R
+++ b/R/inverse.predict.lm.R
@@ -55,11 +55,12 @@ inverse.predict.rlm <- function(object, newdata, ...,
yx <- split(object$model$y,object$model$x)
n <- length(yx)
+ df <- n - length(objects$coef)
x <- as.numeric(names(yx))
ybar <- sapply(yx,mean)
yhatx <- split(object$fitted.values,object$model$x)
yhat <- sapply(yhatx,mean)
- se <- sqrt(sum(w*(ybar - yhat)^2)/(n-2))
+ se <- sqrt(sum(w*(ybar - yhat)^2)/df)
if (ss == "auto") {
ss <- se
} else {

Contact - Imprint