From 513dfbdcdda94a901b5901b486ff5500c7d158b1 Mon Sep 17 00:00:00 2001 From: ranke Date: Wed, 10 May 2006 15:44:14 +0000 Subject: The inverse prediction works in a variety of cases and is tested with Examples 7 and 8 from Massart! I need to compare with the DIN and draper examples, and finish the package vignette. git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/chemCal@6 5fad18fb-23f0-0310-ab10-e59a3bee62b4 --- demo/massart97ex3.R | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'demo') diff --git a/demo/massart97ex3.R b/demo/massart97ex3.R index 7bf9633..731aba6 100644 --- a/demo/massart97ex3.R +++ b/demo/massart97ex3.R @@ -1,12 +1,15 @@ library(chemCal) data(massart97ex3) attach(massart97ex3) -xi <- levels(factor(x)) yx <- split(y,factor(x)) -ybari <- sapply(yx,mean) -si <- round(sapply(yx,sd),digits=2) -wi <- round(1/(si^2),digits=3) -data.frame(xi,ybari,si,wi) +ybar <- sapply(yx,mean) +s <- round(sapply(yx,sd),digits=2) +w <- round(1/(si^2),digits=3) +data.frame(x=levels(factor(x)),ybar,s,w) -weights <- wi[factor(x)] +weights <- w[factor(x)] m <- lm(y ~ x,w=weights) +inverse.predict(m,15,ws=1.67) +inverse.predict(m,90,ws=0.145) + +calplot(m) -- cgit v1.2.1