library(MASS) # ydata.txt und epg.txt in einem Verzeichnis speichern pfad = "Name von diesem Verzeichnis, zB c:/meinedaten" ydata = read.table(paste(pfad, "ydata.txt", sep="/"), header=T) edat = read.table(paste(pfad, "epg.txt", sep="/")) attach(ydata) names(ydata) pairs(ydata) regm = lm(F2 ~ DORSX+DORSY+LIPX+LIPY) coef(regm) summary(regm) n = length(F2) 1-(1-0.3939) * ( (n-1)/(n-4-1) ) stepAIC(regm) summary(regm) lip.lm = lm(F2 ~ LIPX + LIPY) summary(lip.lm) # reg3.txt mit cut-and-paste in R kopieren m = function(x, y, k) { k[1] + x * k[2] + y * k[3] } reg3(lip.lm, m) reg3(lip.lm, m, theta = 120, phi = 25, col="lightblue", expand=.75, ticktype="detailed" , xlab="LIPX", ylab="LIPY", zlab="F2 (Hz)") ############################################# detach(ydata) attach(edat) plot(COG, F2) regp = lm(F2 ~ COG + I(COG^2)) k = coef(regp) plot(COG, F2) curve(k[1] + k[2]*x + k[3]*x^2, add=T) summary(regp) stepAIC(regp) ############################################# epg = read.table(paste(pfad, "epg.txt", sep="/")) attach(epg) regp = lm(F2 ~ COG + I(COG^2)) shapiro.test(resid(regp)) plot(resid(regp)) abline(h=0, lty=2) acf(resid(regp)) plot(regp, 4) plot(COG, F2, cex = 10*sqrt(cooks.distance(regp))) text(COG, F2, as.character(1:length(F2)))