## LiMo: plot(trees) # Scatterplotmatrix ... plot(trees$Girth, trees$Volume) # ... etwas größer lm(trees$Volume ~ trees$Girth) # lineare Regression, oder: Baum.lm <- lm(Volume ~ Girth, data = trees) Baum.lm # Parameterschätzung wird angegeben abline(Baum.lm) # Regressionsgerade einzeichnen summary(Baum.lm) # viel mehr Details, u.a. R^2 plot(Baum.lm) # Oh Je! ## Grafik wiederherstellen: plot(trees$Girth, trees$Volume) abline(Baum.lm) ## Konfidenzintervall berechnen und zeichnen: int <- predict(Baum.lm, interval ="confidence") lines(trees$Girth, int[, "lwr"], col="blue") lines(trees$Girth, int[, "upr"], col="blue") ## Prognoseintervall berechnen und zeichnen: int <- predict(Baum.lm, interval ="prediction") lines(trees$Girth, int[, "lwr"], col="red") lines(trees$Girth, int[, "upr"], col="red") ## Zeitreihen plot(co2) m <- decompose(co2) plot(m) ## Klassifikation library("MASS") irislda <- lda(Species ~ ., data = iris) predict(irislda)$class library("klaR") partimat(Species ~ ., data = iris, method = "lda") library("rpart") irisrpart <- rpart(Species ~ ., data = iris) plot(irisrpart) text(irisrpart) library("party") irisct <- ctree(Species ~ .,data = iris) plot(irisct) ### PACKAGES: library(help = "survival") library("survival") detach("package:survival") .libPaths("c:/temp") .libPaths()