#Lineare Regression und Korrelationstest x <- c(1, 3, 6, 11, 12, 15, 19, 23, 28, 33, 35, 39, 47, 60, 66, 73) y <- c(3180, 2960, 3220, 3270, 3350, 3410, 3700, 3830, 4090, 4310, 4360, 4520, 4650, 5310, 5490, 5540) bsp5 <- data.frame(x,y) colnames(bsp5) <- c("Lebenstag", "Gewicht") rm(x,y) View(bsp5) attach(bsp5) plot(Lebenstag, Gewicht) fm <- lm(Gewicht ~ Lebenstag) fm summary(fm) fitted.values(fm) plot(Lebenstag, Gewicht) abline(fm, col="black") cor(Gewicht, Lebenstag, method="pearson") cor.test(Gewicht, Lebenstag, method="pearson")