############ # Blatt 10 # ############ #aufgabe 1 Cars <- read.table(".../Cars.txt",header=T,sep="\t",quote="") attach(Cars) #a mod1<-lm(City.Miles.Per.Gallon ~ Weight..Pounds.) mod1 summary(mod1) mod2<-lm(City.Miles.Per.Gallon ~ Horsepower) mod2 summary(mod2) par(mfrow = c(1,2)) plot(Weight..Pounds., City.Miles.Per.Gallon, pch = 19) abline(mod1) plot(Horsepower, City.Miles.Per.Gallon, pch = 19) abline(mod2) #Gibt sehr starke Ausreisser, Linearitaet des Modells verletzt (sehr schlecht) #b JavaGD() par(mfrow = c(2,2)) plot(mod1, pch = 19) JavaGD() par(mfrow = c(2,2)) plot(mod2, pch = 19) #c cmpg<-1/City.Miles.Per.Gallon mod3<-lm(cmpg ~ Weight..Pounds.) mod3 summary(mod3) JavaGD() par(mfrow = c(2,2)) plot(mod3, pch = 19) #plot(Weight..Pounds., cmpg, pch = 19) #Transformation fuehrt zu linearem Zusammenhang #Durch Tranformation wird Komplexitaet groesser, Interpretation kann erschwert werden, Definiertheit nicht gesichert #aufgabe 4 #a qwilcox(0.975,11,13) qwilcox(0.95,11,13) 1-pwilcox(129,13,11) #b mu<-11* 13 / 2 sigma<-sqrt(11 * 13 * (11+13+1) /12) 1-pnorm(129, mu, sigma)