diff options
author | ranke <ranke@5fad18fb-23f0-0310-ab10-e59a3bee62b4> | 2006-05-09 20:28:46 +0000 |
---|---|---|
committer | ranke <ranke@5fad18fb-23f0-0310-ab10-e59a3bee62b4> | 2006-05-09 20:28:46 +0000 |
commit | 8d30b2cd951c992e4f9aa3055054091e18b8b4f0 (patch) | |
tree | 82c054517c44d2756690de73381791afba6c4e07 /demo | |
parent | d00de8b829e1a426742df43c25e8982e2f9426af (diff) |
Added the example data, and validated it by writing
a demo producing the first four columns from Table 8.5
and the weighted regression.
git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/chemCal@5 5fad18fb-23f0-0310-ab10-e59a3bee62b4
Diffstat (limited to 'demo')
-rw-r--r-- | demo/00Index | 2 | ||||
-rw-r--r-- | demo/massart97ex3.R | 12 | ||||
-rw-r--r-- | demo/massart97ex8.R | 12 |
3 files changed, 26 insertions, 0 deletions
diff --git a/demo/00Index b/demo/00Index new file mode 100644 index 0000000..8749adf --- /dev/null +++ b/demo/00Index @@ -0,0 +1,2 @@ +massart97ex3 Analysis of example 3 in Massart (1997) +massart97ex8 Analysis of example 8 in Massart (1997) diff --git a/demo/massart97ex3.R b/demo/massart97ex3.R new file mode 100644 index 0000000..7bf9633 --- /dev/null +++ b/demo/massart97ex3.R @@ -0,0 +1,12 @@ +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) + +weights <- wi[factor(x)] +m <- lm(y ~ x,w=weights) diff --git a/demo/massart97ex8.R b/demo/massart97ex8.R new file mode 100644 index 0000000..332bd1d --- /dev/null +++ b/demo/massart97ex8.R @@ -0,0 +1,12 @@ +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) +weights <- wi[factor(x)] +m <- lm(y ~ x,w=weights) +inverse.predict(m,15) +inverse.predict(m,90) |