# Zur Erinnerung # (Daten von Mareike PlŸschke) mp = read.table(file.path(pfad, "mp.txt")) mp.lm = lm(durv1 ~ peak, data = mp) abline(mp.lm) # Werte vorhersagen predict(mp.lm) new = data.frame(peak = 2) predict(mp.lm, new) with(mp, plot(peak, durv1, ylim = c(-50, 250), xlim=c(0, 2))) abline(mp.lm) points(2, predict(mp.lm, new)) summary(mp.lm) # Es gab eine signifikante lineare Beziehung zwischen # durv1 und peak (R^2 = 0.46, p < 0.001) library(MASS) ydata = read.table(file.path(pfad, "ydata.txt")) names(ydata) pairs(ydata) regm = lm(F2 ~ DORSX+DORSY+LIPX+LIPY, data = ydata) coef(regm) summary(regm) n = with(ydata, length(F2)) 1-(1-0.3939) * ( (n-1)/(n-4-1) ) library(MASS) stepAIC(regm) summary(regm) lip.lm = lm(F2 ~ LIPX + LIPY, data = ydata) summary(lip.lm) epg = read.table(paste(pfad, "epg.txt", sep="/")) with(epg, plot(COG, F2)) regp = lm(F2 ~ COG + I(COG^2), data = epg) k = coef(regp) with(epg, plot(COG, F2)) curve(k[1] + k[2]*x + k[3]*x^2, add=T) summary(regp) stepAIC(regp) ############################################# regp = lm(F2 ~ COG + I(COG^2), data = epg) shapiro.test(resid(regp)) plot(resid(regp)) abline(h=0, lty=2) acf(resid(regp)) plot(regp, 4) with(epg, plot(COG, F2, cex = 10*sqrt(cooks.distance(regp)))) with(epg, text(COG, F2, as.character(1:length(F2))))