diff options
author | ranke <ranke@5fad18fb-23f0-0310-ab10-e59a3bee62b4> | 2006-05-10 15:44:14 +0000 |
---|---|---|
committer | ranke <ranke@5fad18fb-23f0-0310-ab10-e59a3bee62b4> | 2006-05-10 15:44:14 +0000 |
commit | 513dfbdcdda94a901b5901b486ff5500c7d158b1 (patch) | |
tree | fefbf7daadbd7da71add3ed63b3d3b07c4c8e4df /demo | |
parent | 8d30b2cd951c992e4f9aa3055054091e18b8b4f0 (diff) |
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
Diffstat (limited to 'demo')
-rw-r--r-- | demo/massart97ex3.R | 15 |
1 files changed, 9 insertions, 6 deletions
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) |