From 0973370a6e27952df81aaae2a05104195e3bf633 Mon Sep 17 00:00:00 2001 From: ranke Date: Mon, 15 May 2006 23:07:31 +0000 Subject: 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 --- R/inverse.predict.lm.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'R/inverse.predict.lm.R') 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 { -- cgit v1.2.1