[RsR] Wanted: predict.lmrob
Locher René (lore)
|ore @end|ng |rom zh@w@ch
Thu Sep 13 19:00:18 CEST 2007
Dear Matias
predict.lmrob() seems not to exist and predict.lm() gives an incorrect result. Is there another convenient trick to predict other data than the fitted? Below you 'll find a short example.
library(robustbase)
xy <- data.frame(x=1:10, y=(1:10)+rnorm(10))
res <- lmrob(y~x, xy)
fitted(res)
## correct
predict(res,newdata=data.frame(x=10:20))
## Error in predict(res, newdata = data.frame(x = 10:20)) :
## no applicable method for "predict"
predict.lm(res,newdata=data.frame(x=10:20))
## does not work properly!
sessionInfo()
## R version 2.5.1 (2007-06-27)
## i386-pc-mingw32
##
## locale:
## LC_COLLATE=German_Switzerland.1252;LC_CTYPE=German_Switzerland.1252;LC_MONETARY=German_Switzerland.1252;LC_NUMERIC=C;LC_TIME=German_Switzerland.1252
##
## attached base packages:
## [1] "stats" "graphics" "grDevices" "utils" "datasets" "methods"
## [7] "base"
##
## other attached packages:
## robustbase
## "0.2-8"
Kind regards and thanks in advance
René
René Locher E-Mail: rene.locher using zhaw.ch
Institut für Datenanalyse und Prozessdesign Tel: +41 58 934 7810
Zürcher Hochschule für angewandte Wissenschaften Fax: +41 58 935 7810
Rosenstrasse 3
Postfach
CH-8400 Winterthur http://www.idp.zhaw.ch
More information about the R-SIG-Robust
mailing list