F2 = as.numeric(rownames(ui)) g.ui = glm(ui ~ F2, binomial) p = ui[,1]/apply(ui, 1, sum) plot(F2, p) k = coef(g.ui)[1] m = coef(g.ui)[2] curve(exp(m*x + k)/(1+ exp(m*x+k)), xlim=c(1000, 2500), add=T, col=2) um = -k/m abline(v = um) # stim = factor(c("J", "J", "J", "J", "N", "N", "J", "N", "J", "J", "J", "N", "J", "N", "N", "N", "J", "J", "N", "J")) vpn = c(rep("B", 12), rep("H", 8)) daten = data.frame(stim, Vpn = factor(vpn)) g = glm(stim ~ Vpn, binomial, data=daten) anova(g, test="Chisq") ############################# attach(lost3) beide = paste(Alter, G, sep=".") tab = table(Vowel, beide) barplot(tab, beside=T, legend=T) temp = Vowel=="high" interaction.plot(Alter, G, temp) tabalter = table(Vowel, Alter) tabg = table(Vowel, G) par(mfrow=c(1,2)) barplot(tabalter, beside=T, legend=T) barplot(tabg, beside=T, legend=T) g = glm(Vowel ~ Alter * G, binomial) anova(g, test="Chisq") # oder g2 = glm(Vowel ~ Alter * G, binomial, data=lost3b) anova(g2, test="Chisq") #################################### attach(ver) erfolg = Lab == K beide = paste(G, Lab, sep=".") tab = table(erfolg, beide) barplot(tab, beside=T, legend=T) space = c(0, 0, .5, 0, .5, 0, 2, 0, .5, 0, .5, 0) barplot(tab, beside=T, legend=T, space=space, ylab="Anzahl") # Frage (a) tabneu = table(erfolg, K) barplot(tabneu, beside=T, legend=T) # Frage (b) tabg = table(erfolg, G) barplot(tabg, beside=T, legend=T) # Frage (c) interaction.plot(K, G, erfolg) g = glm(erfolg ~ K * G, binomial)