library(MASS) # dB-RMS Energie zum Mittelpunkt avrms = dcut(vowlax.rms, .5, prop=T) temp = vowlax.l == "a" & vowlax.spkr=="68" dat = cbind(dcut(vowlax.fdat[temp,1], .5, prop=T), avrms[temp], dur(vowlax[temp,])) colnames(dat) = c("F1", "RMS", "d") dat = data.frame(dat) attach(dat) par(mfrow=c(1,2)) plot(RMS, F1) plot(d, F1) o = lm(F1 ~ RMS+d) summary(o) stepAIC(o) # Normalverteilung pruefen shapiro.test(resid(o)) # Konstante Varianz? plot(resid(o)) # Autokorrelation? acf(resid(o)) plot(o, 4) ############## pfad = "das Verzeichnis wo queen.txt gespeichert ist" queen = read.table(paste(pfad, "queen.txt", sep="/")) plot(f0, Alter) r = lm(Alter ~ f0 + I(f0^2)) summary(r) stepAIC(r) k = coef(r) curve(k[1] + k[2]*x + k[3]*x^2, add=T, col="blue", lwd=2) pfun <- function(k, x=250) { k[1] + k[2]*x + k[3]*x^2 } pfun(k, x=seq(200, to=300, by=10)) # In order to predict f0 from age, then the lm regression # has to be done the other way round plot(Alter, f0) r = lm(f0 ~ Alter + I(Alter^2)) summary(r) stepAIC(r) k = coef(r) curve(k[1] + k[2]*x + k[3]*x^2, add=T, col="blue", lwd=2) pfun(k, x=100) [1] 261.7433 # i.e. a parabola may be the wrong model