cdaten = read.table(file.path(pfad, "compdaten.txt"), header=T) vpn = cdaten$Vpn vpn[vpn=="Sfr"] = "sfr" vpn = factor(vpn) cdaten[,5] = vpn tp = substring(cdaten$Satz, 1, 1) cdaten = cbind(cdaten, factor(tp)) names(cdaten)[6] = "Wtype" n = paste("s", substring(cdaten$Satz, 2, 2), sep="") cdaten = cbind(cdaten, factor(n)) names(cdaten)[7] = "Stype" cdaten = cdaten[,-4] # vowel duration in /Ik/ vs /Iks/ # i.e. s2 vs s3 temp = cdaten$Stype %in% c("s2", "s3") ca = cdaten[temp,] cb = cdaten[!temp,] ca$Stype = factor(ca$Stype) cb$Stype = factor(cb$Stype) # compute difference values temp = ca$Stype == "s2" x = ca[temp,] y = ca[!temp,] any(paste(x$Vpn, x$Wtype) !=paste(y$Vpn, y$Wtype)) xw = x$Wortd - y$Wortd xv = x$Vokd - y$Vokd xc = x$Clustd - y$Clustd x = data.frame(wd = xw, vd = xv, cld = xc, Vpn = x$Vpn, W = y$Wtype) # so the durations in x should be bigger # is duration of V in klick/knick > klicks, knicks? par(mfrow=c(1,2)) # is duration of Cluster in klick/knick > klicks, knicks? boxplot(cld * 1000 ~ W, data = x, main = "Clusterdauer", ylab = "Dauer (ms)") abline(h=0, lty=2, col="blue") boxplot(vd * 1000 ~ W, data = x, main = "Vokaldauer") abline(h=0, lty=2, col="blue") # boxplot((cld + vd) * 1000 ~ W, data = x, main = "Cluster+Vokaldauer") # abline(h=0, lty=2, col="blue") # compute difference values temp = cb$Stype == "s1" X = cb[temp,] temp = cb$Stype == "s4" Y = cb[temp,] temp = cb$Stype == "s5" Z = cb[temp,] yw = X$Wortd - Y$Wortd yv = X$Vokd - Y$Vokd yc = X$Clustd - Y$Clustd y = data.frame(wd = yw, vd = yv, cld = yc, Vpn = X$Vpn, W = Y$Wtype) # is duration of Cluster in kl/nickt > kl/nickten? boxplot(cld*1000 ~ W, data = y, main = "Clusterdauer", ylab= "Dauer (ms)") abline(h=0, lty=2, col="blue") # Is the duration of V bigger in kl/nickt than in kl/nickten boxplot(vd*1000 ~ W, data = y, main = "Vokaldauer", ylab= "Dauer (ms)") abline(h=0, lty=2, col="blue") zw = X$Wortd - Z$Wortd zv = X$Vokd - Z$Vokd zc = X$Clustd - Z$Clustd z = data.frame(wd = zw, vd = zv, cld = zc, Vpn = X$Vpn, W = Z$Wtype) # is duration of Cluster in kl/nickt > gekl/nickten? boxplot(cld*1000 ~ W, data = z, main = "Clusterdauer", ylab= "Dauer (ms)") abline(h=0, lty=2, col="blue") # Is the duration of V bigger in gekl/nickt than in gekl/nickten boxplot(vd*1000 ~ W, data = z, main = "Vokaldauer", ylab= "Dauer (ms)") abline(h=0, lty=2, col="blue") # Wortdauer in kl/nickten, gekl/nickten ylim = c(-100, 100) boxplot(wd*1000 ~ W, data = y, main = "Wortdauer", ylab= "Dauer (ms)", ylim=ylim) abline(h=0, lty=2, col="blue") boxplot(wd*1000 ~ W, data = z, main = "Wortdauer", ylab= "Dauer (ms)", ylim=ylim) abline(h=0, lty=2, col="blue")