# Aufgabe 4 n <- 10 data <- read.table("C:/Lehre/Wirtschaftsstatistik2012/Blatt5/matphys.txt", header = TRUE) # a) plot(data$Mathematik, data$Physik, xlab = "Mathe-Note", ylab = "Physik-Note") # b) modell1 <- lm(data$Physik ~ data$Mathematik) modell1$coefficients abline(modell1$coefficients[1], modell1$coefficients[2], lwd = 2) # c) modell2 <- lm(data$Mathematik ~ data$Physik) modell2$coefficients abline(- modell2$coefficients[1] / modell2$coefficients[2], 1 / modell2$coefficients[2], lwd = 2, lty = 2) legend(x = 65, y = 95, legend = c("b)", "c)"), lty = c(1, 2), lwd = c(2, 2)) # d) summary(modell1) summary(modell2)