########### # Blatt 4 # ########### #Aufgabe 2 #a Math<-read.table(".../Math.txt",header=T,sep="\t", quote="") attach(Math) summary(Math) #Dnote steht fuer Note der Diplomarbeit #b #Histogramm hist(VorDauer[Studienrichtung == "math"] + HauptDauer[Studienrichtung == "math"], xlab = "Studiendauer", main = "Studiendauer eines Mathematikers", breaks = 12, col = "grey") hist(VorDauer[Studienrichtung == "wima"] + HauptDauer[Studienrichtung == "wima"], xlab = "Studiendauer", main = "Studiendauer eines Wirtschaftsmathematikers", breaks = 12, col = "grey") #Streudiagramm plot(VorDauer[Studienrichtung == "math"] + HauptDauer[Studienrichtung == "math"], rep(0.1,153), pch = 20, xlab = "Studiendauer", ylim = c(-0.2,0.2), xlim = c(3,12), ylab = "", yaxt = "n" ) points(VorDauer[Studienrichtung == "wima"] + HauptDauer[Studienrichtung == "wima"], rep (-0.1,198), col = "magenta", pch =20) #Boxplot boxplot(VorDauer[Studienrichtung == "math"] + HauptDauer[Studienrichtung == "math"], VorDauer[Studienrichtung == "wima"] + HauptDauer[Studienrichtung == "wima"],names = c("Mathe", "Wima")) #Schaetzen mu_m<-mean(VorDauer[Studienrichtung == "math"] + HauptDauer[Studienrichtung == "math"]) mu_w<-mean(VorDauer[Studienrichtung == "wima"] + HauptDauer[Studienrichtung == "wima"]) sigma_m<-sd(VorDauer[Studienrichtung == "math"] + HauptDauer[Studienrichtung == "math"]) sigma_w<-sd(VorDauer[Studienrichtung == "wima"] + HauptDauer[Studienrichtung == "wima"]) #sechs Semester 1-pnorm(3, mean=mu_m, sd=sigma_m) 1-pnorm(3, mean=mu_w, sd=sigma_w) #sechs Jahre 1-pnorm(6, mean=mu_m, sd=sigma_m) 1-pnorm(6, mean=mu_w, sd=sigma_w) #c plot(VDnote, HDnote, pch = 20) diff<-VDnote-HDnote points(VDnote[diff > 1.5], HDnote[diff > 1.5], pch = 19, col = "green") points(VDnote[diff < -1], HDnote[diff < -1], pch = 19, col = "magenta") abline(0,1)