diff options
Diffstat (limited to 'demo/massart97ex8.R')
-rw-r--r-- | demo/massart97ex8.R | 12 |
1 files changed, 12 insertions, 0 deletions
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) |