R version 2.8.1 (2008-12-22) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. During startup - Warning messages: 1: Setting LC_CTYPE failed, using "C" 2: Setting LC_COLLATE failed, using "C" 3: Setting LC_TIME failed, using "C" 4: Setting LC_MESSAGES failed, using "C" WARNING: You're using a non-UTF8 locale, therefore only ASCII characters will work. Please read R for Mac OS X FAQ (see Help) section 9 and adjust your system preferences accordingly. [Workspace restored from /Users/jmh/.RData] Loading required package: tcltk Loading Tcl/Tk interface ... done Loading required package: MASS _ _________ _______ | || ______ \ / _______| | || | _____| || |_______ | || ||______/ \_______ \ | || | _ . . . _ ___| | |_||_||_||.:.:.:.||_|____/ : : : INSTITUTE OF PHONETICS AND SPEECH PROCESSING (C) IPS, University of Munich 2009 R Package of the EMU Speech Database system - Version 4.1 Tcl lib path of EMU Installation: /Library/Tcl /Users/jmh/Library/Tcl For configuration, modify file /Users/jmh/Library/R/2.8/library/emu/emudirectory For support requests, contact http://sourceforge.net/projects/emu > library(car) Attaching package: 'car' The following object(s) are masked from package:emu : ellipse > library(languageR) Loading required package: lattice Loading required package: zipfR Loading required package: Matrix Attaching package: 'Matrix' The following object(s) are masked from package:emu : norm The following object(s) are masked from package:stats : xtabs The following object(s) are masked from package:base : colMeans, colSums, rcond, rowMeans, rowSums Loading required package: lme4 > library(multcomp) Loading required package: mvtnorm > pfad = "/Volumes/Data_1/d/" > attach(paste(pfad, "anova1", sep="")) > soa = read.table(paste(pfad, "soa.txt", sep="")) > vot = read.table(paste(pfad, "vot.txt", sep="")) > alc = read.table(paste(pfad, "alcdata.txt", sep="")) > vr = read.table(paste(pfad, "vr.txt", sep="")) > vrs = read.table(paste(pfad, "vrs.txt", sep="")) > anna = read.table(paste(pfad, "anna.txt", sep="")) > > > attach(vot) > table(Wort, Vpn) Vpn Wort agr gam gbr lbo rlo sbo tjo baten 3 3 3 3 3 3 3 bauten 3 3 3 3 3 3 3 beten 3 3 3 3 3 3 3 beute 3 3 3 3 3 3 3 bieten 3 3 3 3 3 3 3 boeten 3 3 3 3 3 3 3 boten 3 3 3 3 3 3 3 buden 3 3 3 3 3 3 3 daten 3 3 3 3 3 3 3 daude 3 3 3 3 3 3 3 degen 3 3 3 3 3 3 3 deuten 3 3 3 4 3 3 3 diether 3 3 3 3 3 3 3 doesen 3 3 3 3 3 3 3 dolen 3 3 3 1 3 3 3 duden 3 3 3 3 3 3 3 gaben 3 3 3 3 3 3 3 gaeule 3 3 3 3 3 3 3 gaube 3 3 3 3 3 3 3 geben 3 3 3 3 3 3 3 giessen 3 3 3 3 3 3 3 goethe 3 3 3 3 3 3 3 goten 3 3 3 4 2 3 3 guten 3 3 3 3 4 3 3 > > # Formel > d.lmer = lmer(d ~ Cons * G + (1|Wort) + (1|Vpn), data=vot) > > print(d.lmer, corr=F) Linear mixed model fit by REML Formula: d ~ Cons * G + (1 | Wort) + (1 | Vpn) Data: vot AIC BIC logLik deviance REMLdev 3447 3485 -1714 3447 3429 Random effects: Groups Name Variance Std.Dev. Wort (Intercept) 10.898 3.3012 Vpn (Intercept) 26.321 5.1304 Residual 48.580 6.9699 Number of obs: 504, groups: Wort, 24; Vpn, 7 Fixed effects: Estimate Std. Error t value (Intercept) 17.9094 2.9060 6.163 Consd 4.3136 1.9242 2.242 Consg 0.2672 1.9245 0.139 GM -1.1928 4.0652 -0.293 Consd:GM 0.3092 1.5376 0.201 Consg:GM 6.4630 1.5369 4.205 > > # in p-Werte umwandeln > d.fnc = pvals.fnc(d.lmer, withMCMC=T) > > d.fnc$fixed Estimate MCMCmean HPD95lower HPD95upper pMCMC Pr(>|t|) (Intercept) 17.9094 17.9101 12.516 23.228 0.0001 0.0000 Consd 4.3136 4.3639 0.851 7.961 0.0220 0.0254 Consg 0.2672 0.2251 -3.393 3.808 0.9048 0.8896 GM -1.1928 -1.2686 -8.796 6.276 0.7186 0.7693 Consd:GM 0.3092 0.3104 -2.644 3.396 0.8468 0.8407 Consg:GM 6.4630 6.4711 3.427 9.471 0.0001 0.0000 > > # Wegen dem Bug, noch einmal > d.lmer = lmer(d ~ Cons * G + (1|Wort) + (1|Vpn), data=vot) > > # Wo kommen Consd und Consg vor? > names(d.fnc$mcmc) [1] "(Intercept)" "Consd" "Consg" [4] "GM" "Consd:GM" "Consg:GM" [7] "Wort (Intercept)" "Vpn (Intercept)" "sigma" > d.aov = aovlmer.fnc(d.lmer, d.fnc$mcmc, 2:3) > > > d.aov $MCMC $MCMC$p [1] 0.0296 $MCMC$which [1] 2 3 $Ftests Analysis of Variance Table Df Sum Sq Mean Sq F value F Df2 p Cons 2 303.36 151.68 3.1223 3.1223 498.00 0.04 G 1 3.43 3.43 0.0706 0.0706 498.00 0.79 Cons:G 2 1093.05 546.53 11.2501 11.2501 498.00 1.665e-05 > > d.lmerohne = lmer(d ~ Cons + G + (1|Wort) + (1|Vpn), data=vot) > anova(d.lmer, d.lmerohne) Data: vot Models: d.lmerohne: d ~ Cons + G + (1 | Wort) + (1 | Vpn) d.lmer: d ~ Cons * G + (1 | Wort) + (1 | Vpn) Df AIC BIC logLik Chisq Chi Df Pr(>Chisq) d.lmerohne 7 3483.5 3513.0 -1734.7 d.lmer 9 3465.4 3503.4 -1723.7 22.084 2 1.602e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > > both = factor(paste(G, Cons, sep=".")) > table(both) both F.b F.d F.g M.b M.d M.g 96 96 96 72 72 72 > > table(both) both F.b F.d F.g M.b M.d M.g 96 96 96 72 72 72 > post.lmer = lmer(d ~ both + (1 | Wort) + (1 | Vpn)) > # NB, F.b ist Basis > levels(both) [1] "F.b" "F.d" "F.g" "M.b" "M.d" "M.g" > print(post.lmer, corr=F) Linear mixed model fit by REML Formula: d ~ both + (1 | Wort) + (1 | Vpn) AIC BIC logLik deviance REMLdev 3447 3485 -1714 3447 3429 Random effects: Groups Name Variance Std.Dev. Wort (Intercept) 10.898 3.3012 Vpn (Intercept) 26.321 5.1304 Residual 48.580 6.9699 Number of obs: 504, groups: Wort, 24; Vpn, 7 Fixed effects: Estimate Std. Error t value (Intercept) 17.9094 2.9060 6.163 bothF.d 4.3136 1.9242 2.242 bothF.g 0.2672 1.9245 0.139 bothM.b -1.1928 4.0652 -0.293 bothM.d 3.4300 4.3800 0.783 bothM.g 5.5374 4.3837 1.263 > > # Matrix der moeglichen Kontraste erstellen > K = diag(length(fixef(post.lmer))) > n = names(fixef(post.lmer)) > rownames(K)= colnames(K) = n > > K (Intercept) bothF.d bothF.g bothM.b bothM.d bothM.g (Intercept) 1 0 0 0 0 0 bothF.d 0 1 0 0 0 0 bothF.g 0 0 1 0 0 0 bothM.b 0 0 0 1 0 0 bothM.d 0 0 0 0 1 0 bothM.g 0 0 0 0 0 1 > > # prueft ob both.F.d und both.F.g sich > # von der Basis-Stufe, both.F.b unterscheiden > plot(confint(glht(post.lmer,linfct= K[2:3,]))) > > summary(glht(post.lmer, linfct = K[2:3,]), test = adjusted("none")) Simultaneous Tests for General Linear Hypotheses Fit: lmer(formula = d ~ both + (1 | Wort) + (1 | Vpn)) Linear Hypotheses: Estimate Std. Error z value Pr(>|z|) bothF.d == 0 4.3136 1.9242 2.242 0.0250 * bothF.g == 0 0.2672 1.9245 0.139 0.8896 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Adjusted p values reported -- none method) > # Wie koennten wir pruefen, ob F.d sich von M.d unterscheiden? > # In dem wir die entsprechenden Reihen von K *subtrahieren* > K = rbind(K, K[2,]-K[5,]) > rownames(K)[7] = "F.d - M.d" > plot(confint(glht(post.lmer,linfct= K[c(2:3,7),]))) > summary(glht(post.lmer, linfct = K[c(2:3,7),]), test = adjusted("none")) Simultaneous Tests for General Linear Hypotheses Fit: lmer(formula = d ~ both + (1 | Wort) + (1 | Vpn)) Linear Hypotheses: Estimate Std. Error z value Pr(>|z|) bothF.d == 0 4.3136 1.9242 2.242 0.0250 * bothF.g == 0 0.2672 1.9245 0.139 0.8896 F.d - M.d == 0 0.8836 4.0656 0.217 0.8280 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Adjusted p values reported -- none method) > > lok.lmer = lmer(slopes ~ Kons * G * P + (1|Spr), data=lok) > lok.fnc = pvals.fnc(lok.lmer, withMCMC=T) > lok.lmer = lmer(slopes ~ Kons * G * P + (1|Spr), data=lok) Error in args(aovlmer) : no function to return from, jumping to top level Error in args(aovlmer) : no function to return from, jumping to top level > lok.aov = aovlmer(lok.lmer, lok.fnc$mcmc, 2:3) Error: could not find function "aovlmer" > lok.aov = aovlmer.fnc(lok.lmer, lok.fnc$mcmc, 2:3) > lok.aov $MCMC $MCMC$p [1] 0.2208 $MCMC$which [1] 2 3 $Ftests Analysis of Variance Table Df Sum Sq Mean Sq F value F Df2 p Kons 2 2.321 1.161 114.7764 114.7764 72.000 0.000 G 1 0.003 0.003 0.3104 0.3104 72.000 0.579 P 2 0.054 0.027 2.6611 2.6611 72.000 0.077 Kons:G 2 0.040 0.020 1.9634 1.9634 72.000 0.148 Kons:P 4 0.627 0.157 15.5009 15.5009 72.000 3.425e-09 G:P 2 0.031 0.015 1.5233 1.5233 72.000 0.225 Kons:G:P 4 0.093 0.023 2.2941 2.2941 72.000 0.068 Error in args(sim) : no function to return from, jumping to top level > > dim(lok) [1] 90 5 > lok[1:10,] slopes Kons G Spr P 1 0.75 b M M1 initial 2 0.74 b M M2 initial 3 0.82 b M M3 initial 4 0.75 b M M4 initial 5 0.61 b M M5 initial 6 0.71 b F F1 initial 7 0.88 b F F2 initial 8 0.78 b F F3 initial 9 0.84 b F F4 initial 10 0.77 b F F5 initial > lok.lmer = lmer(slopes ~ Kons * G * P + (1 | Spr)) Error in eval(expr, envir, enclos) : object "slopes" not found > lok.lmer = lmer(slopes ~ Kons * G * P + (1 | Spr), data=lok) > lok.fnc = pvals.fnc(lok.lmer, withMCMC=T) > > lok.fnc$fixed Estimate MCMCmean HPD95lower HPD95upper pMCMC Pr(>|t|) (Intercept) 0.402 0.4023 0.3037 0.4968 0.0001 0.0000 Konsd -0.060 -0.0604 -0.1849 0.0701 0.3606 0.3486 Konsg 0.054 0.0542 -0.0786 0.1754 0.4088 0.3986 GM 0.200 0.1999 0.0653 0.3334 0.0030 0.0036 Pinitial 0.394 0.3938 0.2634 0.5203 0.0001 0.0000 Pmedial 0.376 0.3765 0.2488 0.5066 0.0001 0.0000 Konsd:GM -0.242 -0.2422 -0.4264 -0.0584 0.0118 0.0089 Konsg:GM -0.254 -0.2549 -0.4356 -0.0750 0.0086 0.0061 Konsd:Pinitial -0.324 -0.3237 -0.5073 -0.1464 0.0010 0.0006 Konsg:Pinitial -0.614 -0.6143 -0.7928 -0.4290 0.0001 0.0000 Konsd:Pmedial -0.288 -0.2892 -0.4635 -0.0949 0.0006 0.0020 Konsg:Pmedial -0.546 -0.5478 -0.7242 -0.3640 0.0001 0.0000 GM:Pinitial -0.262 -0.2615 -0.4478 -0.0808 0.0062 0.0048 GM:Pmedial -0.226 -0.2269 -0.4079 -0.0451 0.0162 0.0142 Konsd:GM:Pinitial 0.222 0.2220 -0.0373 0.4752 0.0900 0.0852 Konsg:GM:Pinitial 0.370 0.3698 0.1166 0.6388 0.0046 0.0048 Konsd:GM:Pmedial 0.196 0.1986 -0.0503 0.4635 0.1306 0.1277 Konsg:GM:Pmedial 0.220 0.2226 -0.0306 0.4793 0.0868 0.0880 > print(lok.lmer, corr=F) Linear mixed model fit by REML Formula: slopes ~ Kons * G * P + (1 | Spr) Data: lok AIC BIC logLik deviance REMLdev -52.61 -2.611 46.3 -172.1 -92.6 Random effects: Groups Name Variance Std.Dev. Spr (Intercept) 0.0012254 0.035006 Residual 0.0132108 0.114938 Number of obs: 90, groups: Spr, 10 Fixed effects: Estimate Std. Error t value (Intercept) 0.40200 0.05406 7.436 Konsd -0.06000 0.07269 -0.825 Konsg 0.05400 0.07269 0.743 GM 0.20000 0.07646 2.616 Pinitial 0.39400 0.07269 5.420 Pmedial 0.37600 0.07269 5.172 Konsd:GM -0.24200 0.10280 -2.354 Konsg:GM -0.25400 0.10280 -2.471 Konsd:Pinitial -0.32400 0.10280 -3.152 Konsg:Pinitial -0.61400 0.10280 -5.973 Konsd:Pmedial -0.28800 0.10280 -2.801 Konsg:Pmedial -0.54600 0.10280 -5.311 GM:Pinitial -0.26200 0.10280 -2.549 GM:Pmedial -0.22600 0.10280 -2.198 Konsd:GM:Pinitial 0.22200 0.14539 1.527 Konsg:GM:Pinitial 0.37000 0.14539 2.545 Konsd:GM:Pmedial 0.19600 0.14539 1.348 Konsg:GM:Pmedial 0.22000 0.14539 1.513 > names(lok.fnc) [1] "fixed" "random" "mcmc" > names(lok.mcmc) Error: object "lok.mcmc" not found > names(lok.fnc$mcmc) [1] "(Intercept)" "Konsd" "Konsg" [4] "GM" "Pinitial" "Pmedial" [7] "Konsd:GM" "Konsg:GM" "Konsd:Pinitial" [10] "Konsg:Pinitial" "Konsd:Pmedial" "Konsg:Pmedial" [13] "GM:Pinitial" "GM:Pmedial" "Konsd:GM:Pinitial" [16] "Konsg:GM:Pinitial" "Konsd:GM:Pmedial" "Konsg:GM:Pmedial" [19] "Spr (Intercept)" "sigma" > lok.lmer = lmer(slopes ~ Kons * G * P + (1 | Spr)) Error in eval(expr, envir, enclos) : object "slopes" not found > lok.lmer = lmer(slopes ~ Kons * G * P + (1 | Spr), data=lok) > lok.aov = aovlmer.fnc(lok.lmer, lok.fnc$mcmc, 2:3) > lok.aov $MCMC $MCMC$p [1] 0.2104 $MCMC$which [1] 2 3 $Ftests Analysis of Variance Table Df Sum Sq Mean Sq F value F Df2 p Kons 2 2.321 1.161 114.7764 114.7764 72.000 0.000 G 1 0.003 0.003 0.3104 0.3104 72.000 0.579 P 2 0.054 0.027 2.6611 2.6611 72.000 0.077 Kons:G 2 0.040 0.020 1.9634 1.9634 72.000 0.148 Kons:P 4 0.627 0.157 15.5009 15.5009 72.000 3.425e-09 G:P 2 0.031 0.015 1.5233 1.5233 72.000 0.225 Kons:G:P 4 0.093 0.023 2.2941 2.2941 72.000 0.068 > names(lok.fnc$mcmc) [1] "(Intercept)" "Konsd" "Konsg" [4] "GM" "Pinitial" "Pmedial" [7] "Konsd:GM" "Konsg:GM" "Konsd:Pinitial" [10] "Konsg:Pinitial" "Konsd:Pmedial" "Konsg:Pmedial" [13] "GM:Pinitial" "GM:Pmedial" "Konsd:GM:Pinitial" [16] "Konsg:GM:Pinitial" "Konsd:GM:Pmedial" "Konsg:GM:Pmedial" [19] "Spr (Intercept)" "sigma" > aovlmer.fnc(lok.lmer, lok.mcmc$mcmc, which=c("Konsd:GM", "Konsg:GM")) Error in is(mcmc, "data.frame") : object "lok.mcmc" not found > aovlmer.fnc(lok.lmer, lok.fnc$mcmc, which=c("Konsd:GM", "Konsg:GM")) $MCMC $MCMC$p [1] 0.0114 $MCMC$which [1] "Konsd:GM" "Konsg:GM" $Ftests Analysis of Variance Table Df Sum Sq Mean Sq F value F Df2 p Kons 2 2.321 1.161 114.7764 114.7764 72.000 0.000 G 1 0.003 0.003 0.3104 0.3104 72.000 0.579 P 2 0.054 0.027 2.6611 2.6611 72.000 0.077 Kons:G 2 0.040 0.020 1.9634 1.9634 72.000 0.148 Kons:P 4 0.627 0.157 15.5009 15.5009 72.000 3.425e-09 G:P 2 0.031 0.015 1.5233 1.5233 72.000 0.225 Kons:G:P 4 0.093 0.023 2.2941 2.2941 72.000 0.068 > aovlmer.fnc(lok.lmer, lok.fnc$mcmc, 7:8) $MCMC $MCMC$p [1] 0.0114 $MCMC$which [1] 7 8 $Ftests Analysis of Variance Table Df Sum Sq Mean Sq F value F Df2 p Kons 2 2.321 1.161 114.7764 114.7764 72.000 0.000 G 1 0.003 0.003 0.3104 0.3104 72.000 0.579 P 2 0.054 0.027 2.6611 2.6611 72.000 0.077 Kons:G 2 0.040 0.020 1.9634 1.9634 72.000 0.148 Kons:P 4 0.627 0.157 15.5009 15.5009 72.000 3.425e-09 G:P 2 0.031 0.015 1.5233 1.5233 72.000 0.225 Kons:G:P 4 0.093 0.023 2.2941 2.2941 72.000 0.068 > lok[1:4,] slopes Kons G Spr P 1 0.75 b M M1 initial 2 0.74 b M M2 initial 3 0.82 b M M3 initial 4 0.75 b M M4 initial > lok.t = Anova.prepare(lok, c("d", "w", "b", "s", "w")) > lok.t$b G M1 "M" M2 "M" M3 "M" M4 "M" M5 "M" F1 "F" F2 "F" F3 "F" F4 "F" F5 "F" Error in args(factr) : no function to return from, jumping to top level > gender = factor(lok.t$b) > lok.lm = lm(lok.t$d ~ gender) > lok.aov2 = Anova(lok.lm, idata=lok.t$w, idesign= ~ Kons * P) > lok.aov2 Type II Repeated Measures MANOVA Tests: Pillai test statistic Df test stat approx F num Df den Df Pr(>F) gender 1 0.037 0.310 1 8 0.592637 Kons 1 0.959 81.655 2 7 1.408e-05 *** gender:Kons 1 0.353 1.911 2 7 0.217704 P 1 0.434 2.687 2 7 0.136145 gender:P 1 0.336 1.770 2 7 0.238697 Kons:P 1 0.931 16.969 4 5 0.004104 ** gender:Kons:P 1 0.683 2.692 4 5 0.153305 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > lok.aov $MCMC $MCMC$p [1] 0.2104 $MCMC$which [1] 2 3 $Ftests Analysis of Variance Table Df Sum Sq Mean Sq F value F Df2 p Kons 2 2.321 1.161 114.7764 114.7764 72.000 0.000 G 1 0.003 0.003 0.3104 0.3104 72.000 0.579 P 2 0.054 0.027 2.6611 2.6611 72.000 0.077 Kons:G 2 0.040 0.020 1.9634 1.9634 72.000 0.148 Kons:P 4 0.627 0.157 15.5009 15.5009 72.000 3.425e-09 G:P 2 0.031 0.015 1.5233 1.5233 72.000 0.225 Kons:G:P 4 0.093 0.023 2.2941 2.2941 72.000 0.068 > summary(lok.aov2, mult=F) Univariate Type II Repeated-Measures ANOVA Assuming Sphericity SS num Df Error SS den Df F Pr(>F) gender 0.00576 1 0.14842 8 0.3105 0.59264 Kons 2.32113 2 0.26196 16 70.8838 1.119e-08 *** gender:Kons 0.03971 2 0.26196 16 1.2126 0.32335 P 0.05382 2 0.12584 16 3.4211 0.05795 . gender:P 0.03081 2 0.12584 16 1.9584 0.17346 Kons:P 0.62695 4 0.25933 32 19.3407 3.557e-08 *** gender:Kons:P 0.09279 4 0.25933 32 2.8624 0.03908 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Mauchly Tests for Sphericity Test statistic p-value Kons 0.79419 0.44640 gender:Kons 0.79419 0.44640 P 0.84164 0.54695 gender:P 0.84164 0.54695 Kons:P 0.11327 0.13531 gender:Kons:P 0.11327 0.13531 Greenhouse-Geisser and Huynh-Feldt Corrections for Departure from Sphericity GG eps Pr(>F[GG]) Kons 0.82932 1.636e-07 *** gender:Kons 0.82932 0.31962 P 0.86329 0.06757 . gender:P 0.86329 0.18106 Kons:P 0.57672 1.727e-05 *** gender:Kons:P 0.57672 0.07644 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 HF eps Pr(>F[HF]) Kons 1.01931 1.119e-08 *** gender:Kons 1.01931 0.32335 P 1.07910 0.05795 . gender:P 1.07910 0.17346 Kons:P 0.82389 4.608e-07 *** gender:Kons:P 0.82389 0.05149 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Warning message: In summary.Anova.mlm(lok.aov2, mult = F) : HF eps > 1 treated as 1 > d.aov = aovlmer.fnc(d.lmer, d.fnc$mcmc, 2:3) > d.aov $MCMC $MCMC$p [1] 0.0296 $MCMC$which [1] 2 3 $Ftests Analysis of Variance Table Df Sum Sq Mean Sq F value F Df2 p Cons 2 303.36 151.68 3.1223 3.1223 498.00 0.04 G 1 3.43 3.43 0.0706 0.0706 498.00 0.79 Cons:G 2 1093.05 546.53 11.2501 11.2501 498.00 1.665e-05 > attach(vot) The following object(s) are masked from vot ( position 3 ) : Cons G Vow Vpn Wort d > search() [1] ".GlobalEnv" "vot" [3] "vot" "file:/Volumes/Data_1/d/anova1" [5] "package:multcomp" "package:mvtnorm" [7] "package:languageR" "package:lme4" [9] "package:Matrix" "package:zipfR" [11] "package:lattice" "package:car" [13] "package:emu" "package:MASS" [15] "package:tcltk" "tools:RGUI" [17] "package:stats" "package:graphics" [19] "package:grDevices" "package:utils" [21] "package:datasets" "package:methods" [23] "Autoloads" "package:base" > detach(2) > vot[1:4,] d Wort Vow Vpn Cons G 1 19.937 guten u: agr g F 2 22.830 duden u: agr d F 3 38.026 gaeule oy agr g F 4 16.708 duden u: agr d F > table(Cons) Cons b d g 168 168 168 > table(G) G F M 288 216 > d.aov = aovlmer.fnc(d.lmer, d.fnc$mcmc, 2:3) > both = factor(paste(G, Cons, sep=".")) > table(both) both F.b F.d F.g M.b M.d M.g 96 96 96 72 72 72 > post.lmer = lmer(d ~ both + (1 | Wort) + (1 | Vpn)) > levels(both) [1] "F.b" "F.d" "F.g" "M.b" "M.d" "M.g" > > print(post.lmer, corr=F) Linear mixed model fit by REML Formula: d ~ both + (1 | Wort) + (1 | Vpn) AIC BIC logLik deviance REMLdev 3447 3485 -1714 3447 3429 Random effects: Groups Name Variance Std.Dev. Wort (Intercept) 10.898 3.3012 Vpn (Intercept) 26.321 5.1304 Residual 48.580 6.9699 Number of obs: 504, groups: Wort, 24; Vpn, 7 Fixed effects: Estimate Std. Error t value (Intercept) 17.9094 2.9060 6.163 bothF.d 4.3136 1.9242 2.242 bothF.g 0.2672 1.9245 0.139 bothM.b -1.1928 4.0652 -0.293 bothM.d 3.4300 4.3800 0.783 bothM.g 5.5374 4.3837 1.263 > K = diag(length(fixef(post.lmer))) > > K [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 0 0 0 0 0 [2,] 0 1 0 0 0 0 [3,] 0 0 1 0 0 0 [4,] 0 0 0 1 0 0 [5,] 0 0 0 0 1 0 [6,] 0 0 0 0 0 1 > n = names(fixef(post.lmer)) > rownames(K)= colnames(K) = n > > K (Intercept) bothF.d bothF.g bothM.b (Intercept) 1 0 0 0 bothF.d 0 1 0 0 bothF.g 0 0 1 0 bothM.b 0 0 0 1 bothM.d 0 0 0 0 bothM.g 0 0 0 0 bothM.d bothM.g (Intercept) 0 0 bothF.d 0 0 bothF.g 0 0 bothM.b 0 0 bothM.d 1 0 bothM.g 0 1 > plot(confint(glht(post.lmer,linfct= K[2:3,]))) > summary(glht(post.lmer, linfct = K[2:3,]), test = adjusted("none")) Simultaneous Tests for General Linear Hypotheses Fit: lmer(formula = d ~ both + (1 | Wort) + (1 | Vpn)) Linear Hypotheses: Estimate Std. Error z value bothF.d == 0 4.3136 1.9242 2.242 bothF.g == 0 0.2672 1.9245 0.139 Pr(>|z|) bothF.d == 0 0.0250 * bothF.g == 0 0.8896 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Adjusted p values reported -- none method) > > summary(glht(post.lmer, linfct = K[2:3,]), test = adjusted("none")) Simultaneous Tests for General Linear Hypotheses Fit: lmer(formula = d ~ both + (1 | Wort) + (1 | Vpn)) Linear Hypotheses: Estimate Std. Error z value Pr(>|z|) bothF.d == 0 4.3136 1.9242 2.242 0.0250 * bothF.g == 0 0.2672 1.9245 0.139 0.8896 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Adjusted p values reported -- none method) > K (Intercept) bothF.d bothF.g bothM.b bothM.d (Intercept) 1 0 0 0 0 bothF.d 0 1 0 0 0 bothF.g 0 0 1 0 0 bothM.b 0 0 0 1 0 bothM.d 0 0 0 0 1 bothM.g 0 0 0 0 0 bothM.g (Intercept) 0 bothF.d 0 bothF.g 0 bothM.b 0 bothM.d 0 bothM.g 1 > K[2,]-K[5,] (Intercept) bothF.d bothF.g bothM.b bothM.d 0 1 0 0 -1 bothM.g 0 > K = rbind(K, K[2,]-K[5,]) > K (Intercept) bothF.d bothF.g bothM.b bothM.d (Intercept) 1 0 0 0 0 bothF.d 0 1 0 0 0 bothF.g 0 0 1 0 0 bothM.b 0 0 0 1 0 bothM.d 0 0 0 0 1 bothM.g 0 0 0 0 0 0 1 0 0 -1 bothM.g (Intercept) 0 bothF.d 0 bothF.g 0 bothM.b 0 bothM.d 0 bothM.g 1 0 > rownames(K)[7] = "F.d - M.d" > K (Intercept) bothF.d bothF.g bothM.b bothM.d (Intercept) 1 0 0 0 0 bothF.d 0 1 0 0 0 bothF.g 0 0 1 0 0 bothM.b 0 0 0 1 0 bothM.d 0 0 0 0 1 bothM.g 0 0 0 0 0 F.d - M.d 0 1 0 0 -1 bothM.g (Intercept) 0 bothF.d 0 bothF.g 0 bothM.b 0 bothM.d 0 bothM.g 1 F.d - M.d 0 > plot(confint(glht(post.lmer,linfct= K[c(2:3,7),]))) > summary(glht(post.lmer, linfct = K[c(2:3,7),]), test = adjusted("none")) Simultaneous Tests for General Linear Hypotheses Fit: lmer(formula = d ~ both + (1 | Wort) + (1 | Vpn)) Linear Hypotheses: Estimate Std. Error z value Pr(>|z|) bothF.d == 0 4.3136 1.9242 2.242 0.0250 * bothF.g == 0 0.2672 1.9245 0.139 0.8896 F.d - M.d == 0 0.8836 4.0656 0.217 0.8280 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Adjusted p values reported -- none method) > > d.aov $MCMC $MCMC$p [1] 0.0296 $MCMC$which [1] 2 3 $Ftests Analysis of Variance Table Df Sum Sq Mean Sq F value F Df2 p Cons 2 303.36 151.68 3.1223 3.1223 498.00 0.04 G 1 3.43 3.43 0.0706 0.0706 498.00 0.79 Cons:G 2 1093.05 546.53 11.2501 11.2501 498.00 1.665e-05 > alc[1:3,] hes_number hes_restsylnumber Alc G Mode Vpn 1 1 276 a F monologue s006 2 7 316 a F dialogue s006 3 0 99 a F tonguetwister s006 > > table(Alc) Error in table(Alc) : object "Alc" not found > search() [1] ".GlobalEnv" [2] "vot" [3] "file:/Volumes/Data_1/d/anova1" [4] "package:multcomp" [5] "package:mvtnorm" [6] "package:languageR" [7] "package:lme4" [8] "package:Matrix" [9] "package:zipfR" [10] "package:lattice" [11] "package:car" [12] "package:emu" [13] "package:MASS" [14] "package:tcltk" [15] "tools:RGUI" [16] "package:stats" [17] "package:graphics" [18] "package:grDevices" [19] "package:utils" [20] "package:datasets" [21] "package:methods" [22] "Autoloads" [23] "package:base" > detach(2) > alc[1:4,] hes_number hes_restsylnumber Alc G Mode Vpn 1 1 276 a F monologue s006 2 7 316 a F dialogue s006 3 0 99 a F tonguetwister s006 4 0 58 a F adresses s006 > table(Alc) Error in table(Alc) : object "Alc" not found Error in args(atach) : no function to return from, jumping to top level > attach(alc) > table(Alc) Alc a na 480 480 > table(Mode) Mode adresses dialogue monologue spontcommand 192 192 192 192 tonguetwister 192 > class(alc[,1]) [1] "integer" > class(alc[,2]) [1] "integer" > alc.lmer = lmer(alc[,1:2] ~ Mode * Alc * G + (1 | Vpn), data=alc) Error in model.frame.default(data = alc, formula = alc[, 1:2] ~ Mode * : invalid type (list) for variable 'alc[, 1:2]' > prop = alc[,1:2] > class(prop) [1] "data.frame" > prop = as.matrix(prop) > alc.lmer = lmer(prop ~ Mode * Alc * G + (1 | Vpn), data=alc) > alc.lmer = lmer(prop ~ Mode * Alc * G + (1 | Vpn), family="binomial", data=alc) > print(alc.lmer, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: prop ~ Mode * Alc * G + (1 | Vpn) Data: alc AIC BIC logLik deviance 1596 1699 -777.2 1554 Random effects: Groups Name Variance Std.Dev. Vpn (Intercept) 0.49648 0.70461 Number of obs: 960, groups: Vpn, 96 Fixed effects: Estimate Std. Error z value (Intercept) -6.2146 0.3921 -15.848 Modedialogue 2.2135 0.3841 5.762 Modemonologue 2.1926 0.3837 5.714 Modespontcommand 1.0702 0.4294 2.493 Modetonguetwister 0.4014 0.4503 0.891 Alcna 0.0749 0.4700 0.159 GM 0.7105 0.4868 1.460 Modedialogue:Alcna -0.3569 0.4764 -0.749 Modemonologue:Alcna -0.1753 0.4763 -0.368 Modespontcommand:Alcna -0.3523 0.5468 -0.644 Modetonguetwister:Alcna -1.0042 0.5931 -1.693 Modedialogue:GM -0.5525 0.4723 -1.170 Modemonologue:GM -0.5347 0.4716 -1.134 Modespontcommand:GM -0.4725 0.5424 -0.871 Modetonguetwister:GM -0.7312 0.5812 -1.258 Alcna:GM -0.6723 0.6086 -1.105 Modedialogue:Alcna:GM 0.9020 0.6173 1.461 Modemonologue:Alcna:GM 0.8076 0.6171 1.309 Modespontcommand:Alcna:GM 1.3712 0.7075 1.938 Modetonguetwister:Alcna:GM 1.6422 0.7701 2.133 Pr(>|z|) (Intercept) < 2e-16 *** Modedialogue 8.30e-09 *** Modemonologue 1.10e-08 *** Modespontcommand 0.0127 * Modetonguetwister 0.3727 Alcna 0.8734 GM 0.1444 Modedialogue:Alcna 0.4537 Modemonologue:Alcna 0.7129 Modespontcommand:Alcna 0.5194 Modetonguetwister:Alcna 0.0905 . Modedialogue:GM 0.2421 Modemonologue:GM 0.2568 Modespontcommand:GM 0.3836 Modetonguetwister:GM 0.2084 Alcna:GM 0.2693 Modedialogue:Alcna:GM 0.1440 Modemonologue:Alcna:GM 0.1907 Modespontcommand:Alcna:GM 0.0526 . Modetonguetwister:Alcna:GM 0.0330 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Error in args(level) : no function to return from, jumping to top level > level(Mode) Error: could not find function "level" > levels(Mode) [1] "adresses" "dialogue" "monologue" "spontcommand" [5] "tonguetwister" > levels(Mode) [1] "adresses" "dialogue" "monologue" "spontcommand" [5] "tonguetwister" > args(relevel) function (x, ref, ...) NULL > Mode = relevel(Mode, "dialogue") > rm(Mode) > alc.lmer2 = lmer(prop ~ G * Alc * Mode + (1 | Vpn), family="binomial", data=alc) > print(alc.lmer2, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: prop ~ G * Alc * Mode + (1 | Vpn) Data: alc AIC BIC logLik deviance 1596 1699 -777.2 1554 Random effects: Groups Name Variance Std.Dev. Vpn (Intercept) 0.49648 0.70461 Number of obs: 960, groups: Vpn, 96 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -6.21456 0.39213 -15.848 < 2e-16 *** GM 0.71047 0.48678 1.460 0.1444 Alcna 0.07488 0.47001 0.159 0.8734 Modedialogue 2.21349 0.38413 5.762 8.30e-09 *** Modemonologue 2.19257 0.38372 5.714 1.10e-08 *** Modespontcommand 1.07019 0.42935 2.493 0.0127 * Modetonguetwister 0.40139 0.45031 0.891 0.3727 GM:Alcna -0.67233 0.60858 -1.105 0.2693 GM:Modedialogue -0.55245 0.47227 -1.170 0.2421 GM:Modemonologue -0.53474 0.47160 -1.134 0.2568 GM:Modespontcommand -0.47254 0.54238 -0.871 0.3836 GM:Modetonguetwister -0.73116 0.58123 -1.258 0.2084 Alcna:Modedialogue -0.35693 0.47639 -0.749 0.4537 Alcna:Modemonologue -0.17526 0.47632 -0.368 0.7129 Alcna:Modespontcommand -0.35226 0.54681 -0.644 0.5194 Alcna:Modetonguetwister -1.00419 0.59314 -1.693 0.0905 . GM:Alcna:Modedialogue 0.90193 0.61735 1.461 0.1440 GM:Alcna:Modemonologue 0.80756 0.61715 1.309 0.1907 GM:Alcna:Modespontcommand 1.37122 0.70747 1.938 0.0526 . GM:Alcna:Modetonguetwister 1.64226 0.77006 2.133 0.0330 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > alc.lmer3 = lmer(prop ~ Alc + (1 | Vpn), family="binomial", data=alc) > alc.lmer3 Generalized linear mixed model fit by the Laplace approximation Formula: prop ~ Alc + (1 | Vpn) Data: alc AIC BIC logLik deviance 2683 2698 -1339 2677 Random effects: Groups Name Variance Std.Dev. Vpn (Intercept) 0.53003 0.72803 Number of obs: 960, groups: Vpn, 96 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -4.22426 0.08045 -52.51 <2e-16 *** Alcna -0.05886 0.03450 -1.71 0.088 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Correlation of Fixed Effects: (Intr) Alcna -0.284 > alc.lmer3 = lmer(prop ~ Alc * G + (1 | Vpn), family="binomial", data=alc) > alc.lmer3 = lmer(prop ~ Alc * G + (1 | Vpn) + (1 | Mode), family="binomial", data=alc) > print(alc.lmer3, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: prop ~ Alc * G + (1 | Vpn) + (1 | Mode) Data: alc AIC BIC logLik deviance 1617 1646 -802.3 1605 Random effects: Groups Name Variance Std.Dev. Vpn (Intercept) 0.50234 0.70876 Mode (Intercept) 0.82737 0.90960 Number of obs: 960, groups: Vpn, 96; Mode, 5 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -5.01397 0.42289 -11.856 < 2e-16 *** Alcna -0.20359 0.05295 -3.845 0.000121 *** GM 0.17492 0.15742 1.111 0.266492 Alcna:GM 0.20704 0.07015 2.951 0.003165 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > dim(lok) [1] 90 5 > names(lok) [1] "slopes" "Kons" "G" "Spr" "P" > str(lok) 'data.frame': 90 obs. of 5 variables: $ slopes: num 0.75 0.74 0.82 0.75 0.61 0.71 0.88 0.78 0.84 0.77 ... $ Kons : Factor w/ 3 levels "b","d","g": 1 1 1 1 1 1 1 1 1 1 ... $ G : Factor w/ 2 levels "F","M": 2 2 2 2 2 1 1 1 1 1 ... $ Spr : Factor w/ 10 levels "F1","F2","F3",..: 6 7 8 9 10 1 2 3 4 5 ... $ P : Factor w/ 3 levels "final","initial",..: 2 2 2 2 2 2 2 2 2 2 ... > > lok.lmer = lmer(slopes ~ Kons * G * P + (1|Spr), data=lok, verbose=T) 0: -91.194387: 0.544331 1: -92.597231: 0.277262 2: -92.616263: 0.316972 3: -92.621119: 0.304757 4: -92.621120: 0.304558 5: -92.621120: 0.304561 > print(lok.lmer, corr=F) Linear mixed model fit by REML Formula: slopes ~ Kons * G * P + (1 | Spr) Data: lok AIC BIC logLik deviance REMLdev -52.62 -2.625 46.31 -172.1 -92.62 Random effects: Groups Name Variance Std.Dev. Spr (Intercept) 0.00093792 0.030625 Residual 0.01011153 0.100556 Number of obs: 90, groups: Spr, 10 Fixed effects: Estimate Std. Error t value (Intercept) 0.40200 0.04701 8.552 Konsd -0.06000 0.06360 -0.943 Konsg 0.05400 0.06360 0.849 GM 0.20000 0.06648 3.008 Pinitial 0.39400 0.06360 6.195 Pmedial 0.37600 0.06360 5.912 Konsd:GM -0.24200 0.08994 -2.691 Konsg:GM -0.25400 0.08994 -2.824 Konsd:Pinitial -0.32400 0.08994 -3.602 Konsg:Pinitial -0.61400 0.08994 -6.827 Konsd:Pmedial -0.28800 0.08994 -3.202 Konsg:Pmedial -0.54600 0.08994 -6.071 GM:Pinitial -0.26200 0.08994 -2.913 GM:Pmedial -0.22600 0.08994 -2.513 Konsd:GM:Pinitial 0.22200 0.12719 1.745 Konsg:GM:Pinitial 0.37000 0.12719 2.909 Konsd:GM:Pmedial 0.19600 0.12719 1.541 Konsg:GM:Pmedial 0.22000 0.12719 1.730 > levels(Kons) Error in levels(Kons) : object "Kons" not found > with(lok, levels(Kons)) [1] "b" "d" "g" > dotplot(ranef(lok.lmer, post=T)) $Spr > lok.lmer2 = lmer(slopes ~ Kons * G + P + (1|Spr), data=lok, verbose=T) 0: -66.502763: 0.544331 1: -70.962418: 0.00000 2: -70.962418: 0.00000 > lok.lmer2 = lmer(slopes ~ Kons * G + P + (1|Spr), data=lok, verbose=T, REML=F) 0: -103.87823: 0.544331 1: -110.35747: 0.00000 2: -110.35747: 0.00000 > lok.lmer = lmer(slopes ~ Kons * G * P + (1|Spr), data=lok, verbose=T, REML=F) 0: -170.28826: 0.544331 1: -172.04181: 0.277262 2: -172.06560: 0.316970 3: -172.07167: 0.304756 4: -172.07167: 0.304558 5: -172.07167: 0.304561 > anova(lok.lmer, lok.lmer2) Data: lok Models: lok.lmer2: slopes ~ Kons * G + P + (1 | Spr) lok.lmer: slopes ~ Kons * G * P + (1 | Spr) Df AIC BIC logLik Chisq Chi Df Pr(>Chisq) lok.lmer2 10 -90.357 -65.359 55.179 lok.lmer 20 -132.072 -82.075 86.036 61.714 10 1.715e-09 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > lok.lmer2 Linear mixed model fit by maximum likelihood Formula: slopes ~ Kons * G + P + (1 | Spr) Data: lok AIC BIC logLik deviance REMLdev -90.36 -65.36 55.18 -110.4 -70.96 Random effects: Groups Name Variance Std.Dev. Spr (Intercept) 0.000000 0.00000 Residual 0.017179 0.13107 Number of obs: 90, groups: Spr, 10 Fixed effects: Estimate Std. Error t value (Intercept) 0.62422 0.03908 15.974 Konsd -0.26400 0.04786 -5.516 Konsg -0.33267 0.04786 -6.951 GM 0.03733 0.04786 0.780 Pinitial 0.04900 0.03384 1.448 Pmedial 0.05433 0.03384 1.606 Konsd:GM -0.10267 0.06768 -1.517 Konsg:GM -0.05733 0.06768 -0.847 Correlation of Fixed Effects: (Intr) Konsd Konsg GM Pinitl Pmedil Knsd:GM Konsd -0.612 Konsg -0.612 0.500 GM -0.612 0.500 0.500 Pinitial -0.433 0.000 0.000 0.000 Pmedial -0.433 0.000 0.000 0.000 0.500 Konsd:GM 0.433 -0.707 -0.354 -0.707 0.000 0.000 Konsg:GM 0.433 -0.354 -0.707 -0.707 0.000 0.000 0.500 > print(lok.lmer2, corr=F) Linear mixed model fit by maximum likelihood Formula: slopes ~ Kons * G + P + (1 | Spr) Data: lok AIC BIC logLik deviance REMLdev -90.36 -65.36 55.18 -110.4 -70.96 Random effects: Groups Name Variance Std.Dev. Spr (Intercept) 0.000000 0.00000 Residual 0.017179 0.13107 Number of obs: 90, groups: Spr, 10 Fixed effects: Estimate Std. Error t value (Intercept) 0.62422 0.03908 15.974 Konsd -0.26400 0.04786 -5.516 Konsg -0.33267 0.04786 -6.951 GM 0.03733 0.04786 0.780 Pinitial 0.04900 0.03384 1.448 Pmedial 0.05433 0.03384 1.606 Konsd:GM -0.10267 0.06768 -1.517 Konsg:GM -0.05733 0.06768 -0.847 > lok.lmer3 = lmer(slopes ~ Kons + G + P + Kons:P + Kons:G + G:P + (1|Spr), data=lok, verbose=T, REML=F) 0: -158.89611: 0.544331 1: -160.22932: 0.00000 2: -160.22932: 2.06597e-05 3: -160.22935: 0.000736273 4: -161.35212: 0.255759 5: -161.35256: 0.259215 6: -161.35256: 0.259215 7: -161.35256: 0.259215 > anova(lok.lmer, lok.lmer3) Data: lok Models: lok.lmer3: slopes ~ Kons + G + P + Kons:P + Kons:G + G:P + (1 | Spr) lok.lmer: slopes ~ Kons * G * P + (1 | Spr) Df AIC BIC logLik Chisq Chi Df Pr(>Chisq) lok.lmer3 16 -129.353 -89.356 80.676 lok.lmer 20 -132.072 -82.075 86.036 10.719 4 0.02991 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > anova(lok.lmer) Analysis of Variance Table Df Sum Sq Mean Sq F value Kons 2 2.32113 1.16056 143.4705 G 1 0.00314 0.00314 0.3881 P 2 0.05382 0.02691 3.3264 Kons:G 2 0.03971 0.01985 2.4543 Kons:P 4 0.62695 0.15674 19.3761 G:P 2 0.03081 0.01540 1.9042 Kons:G:P 4 0.09279 0.02320 2.8676 > > alc[1:10,] hes_number hes_restsylnumber Alc G Mode Vpn 1 1 276 a F monologue s006 2 7 316 a F dialogue s006 3 0 99 a F tonguetwister s006 4 0 58 a F adresses s006 5 3 63 a F spontcommand s006 6 6 465 na F monologue s006 7 7 586 na F dialogue s006 8 0 195 na F tonguetwister s006 9 1 95 na F adresses s006 10 0 71 na F spontcommand s006 > head(alc) hes_number hes_restsylnumber Alc G Mode Vpn 1 1 276 a F monologue s006 2 7 316 a F dialogue s006 3 0 99 a F tonguetwister s006 4 0 58 a F adresses s006 5 3 63 a F spontcommand s006 6 6 465 na F monologue s006 > head(alc) hes_number hes_restsylnumber Alc G Mode Vpn 1 1 276 a F monologue s006 2 7 316 a F dialogue s006 3 0 99 a F tonguetwister s006 4 0 58 a F adresses s006 5 3 63 a F spontcommand s006 6 6 465 na F monologue s006 > head(alc, 10) hes_number hes_restsylnumber Alc G Mode Vpn 1 1 276 a F monologue s006 2 7 316 a F dialogue s006 3 0 99 a F tonguetwister s006 4 0 58 a F adresses s006 5 3 63 a F spontcommand s006 6 6 465 na F monologue s006 7 7 586 na F dialogue s006 8 0 195 na F tonguetwister s006 9 1 95 na F adresses s006 10 0 71 na F spontcommand s006 > alc.lmer = lmer(as.matrix(alc[,1:2]) ~ Alc * G + (1|Mode) + (1|Vpn), data=alc, family=binomial) > alc.lmer2 = lmer(as.matrix(alc[,1:2]) ~ Alc * G + (1|Mode) + (1|Vpn), data=alc, family=binomial) > print(alc.lmer, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: as.matrix(alc[, 1:2]) ~ Alc * G + (1 | Mode) + (1 | Vpn) Data: alc AIC BIC logLik deviance 1617 1646 -802.3 1605 Random effects: Groups Name Variance Std.Dev. Vpn (Intercept) 0.50234 0.70876 Mode (Intercept) 0.82737 0.90960 Number of obs: 960, groups: Vpn, 96; Mode, 5 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -5.01397 0.42289 -11.856 < 2e-16 *** Alcna -0.20359 0.05295 -3.845 0.000121 *** GM 0.17492 0.15742 1.111 0.266492 Alcna:GM 0.20704 0.07015 2.951 0.003165 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > dotplot(ranef(alc.lmer, post=T)) $Vpn $Mode > > head(alc) hes_number hes_restsylnumber Alc G Mode Vpn 1 1 276 a F monologue s006 2 7 316 a F dialogue s006 3 0 99 a F tonguetwister s006 4 0 58 a F adresses s006 5 3 63 a F spontcommand s006 6 6 465 na F monologue s006 Error in args(relvel) : no function to return from, jumping to top level > G2 = with(alc, relevel(G, "M")) > alc.lmer3 = lmer(as.matrix(alc[,1:2]) ~ Alc * G2 + (1|Mode) + (1|Vpn), data=alc, family=binomial) > print(alc.lmer3, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: as.matrix(alc[, 1:2]) ~ Alc * G2 + (1 | Mode) + (1 | Vpn) Data: alc AIC BIC logLik deviance 1617 1646 -802.3 1605 Random effects: Groups Name Variance Std.Dev. Vpn (Intercept) 0.50234 0.70876 Mode (Intercept) 0.82738 0.90960 Number of obs: 960, groups: Vpn, 96; Mode, 5 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -4.839038 0.423689 -11.421 < 2e-16 *** Alcna 0.003481 0.046190 0.075 0.93993 G2F -0.174910 0.157416 -1.111 0.26651 Alcna:G2F -0.207096 0.070154 -2.952 0.00316 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > print(alc.lmer2, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: as.matrix(alc[, 1:2]) ~ Alc * G + (1 | Mode) + (1 | Vpn) Data: alc AIC BIC logLik deviance 1617 1646 -802.3 1605 Random effects: Groups Name Variance Std.Dev. Vpn (Intercept) 0.50234 0.70876 Mode (Intercept) 0.82737 0.90960 Number of obs: 960, groups: Vpn, 96; Mode, 5 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -5.01397 0.42289 -11.856 < 2e-16 *** Alcna -0.20359 0.05295 -3.845 0.000121 *** GM 0.17492 0.15742 1.111 0.266492 Alcna:GM 0.20704 0.07015 2.951 0.003165 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > p = alc[,1]/alc[,2] > range(p) [1] 0.0000000 0.1549755 > bwplot(p ~ G | Alc, data = alc) > print(alc.lmer2, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: as.matrix(alc[, 1:2]) ~ Alc * G + (1 | Mode) + (1 | Vpn) Data: alc AIC BIC logLik deviance 1617 1646 -802.3 1605 Random effects: Groups Name Variance Std.Dev. Vpn (Intercept) 0.50234 0.70876 Mode (Intercept) 0.82737 0.90960 Number of obs: 960, groups: Vpn, 96; Mode, 5 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -5.01397 0.42289 -11.856 < 2e-16 *** Alcna -0.20359 0.05295 -3.845 0.000121 *** GM 0.17492 0.15742 1.111 0.266492 Alcna:GM 0.20704 0.07015 2.951 0.003165 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > print(alc.lmer, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: as.matrix(alc[, 1:2]) ~ Alc * G + (1 | Mode) + (1 | Vpn) Data: alc AIC BIC logLik deviance 1617 1646 -802.3 1605 Random effects: Groups Name Variance Std.Dev. Vpn (Intercept) 0.50234 0.70876 Mode (Intercept) 0.82737 0.90960 Number of obs: 960, groups: Vpn, 96; Mode, 5 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -5.01397 0.42289 -11.856 < 2e-16 *** Alcna -0.20359 0.05295 -3.845 0.000121 *** GM 0.17492 0.15742 1.111 0.266492 Alcna:GM 0.20704 0.07015 2.951 0.003165 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > alc.lmer4 = lmer(as.matrix(alc[, 1:2]) ~ Alc * G + (1 | Mode) + (1 | Vpn) + (1 | Mode:Vpn), data=alc, family=binomial) > print(alc.lmer4, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: as.matrix(alc[, 1:2]) ~ Alc * G + (1 | Mode) + (1 | Vpn) + (1 | Mode:Vpn) Data: alc AIC BIC logLik deviance 1543 1577 -764.4 1529 Random effects: Groups Name Variance Std.Dev. Mode:Vpn (Intercept) 0.19011 0.43602 Vpn (Intercept) 0.46735 0.68363 Mode (Intercept) 0.90152 0.94948 Number of obs: 960, groups: Mode:Vpn, 480; Vpn, 96; Mode, 5 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -5.12280 0.44090 -11.619 < 2e-16 *** Alcna -0.20566 0.05326 -3.861 0.000113 *** GM 0.21492 0.16222 1.325 0.185207 Alcna:GM 0.20235 0.07056 2.868 0.004133 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > alc.lmer5 = lmer(as.matrix(alc[, 1:2]) ~ Mode + Alc * G + (1 | Vpn) + (1 | Mode:Vpn), data=alc, family=binomial) > > print(alc.lmer5) Generalized linear mixed model fit by the Laplace approximation Formula: as.matrix(alc[, 1:2]) ~ Mode + Alc * G + (1 | Vpn) + (1 | Mode:Vpn) Data: alc AIC BIC logLik deviance 1521 1569 -750.3 1501 Random effects: Groups Name Variance Std.Dev. Mode:Vpn (Intercept) 0.19221 0.43841 Vpn (Intercept) 0.46033 0.67848 Number of obs: 960, groups: Mode:Vpn, 480; Vpn, 96 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -6.15088 0.19503 -31.537 < 2e-16 *** Modedialogue 2.08696 0.17029 12.255 < 2e-16 *** Modemonologue 2.07366 0.17067 12.150 < 2e-16 *** Modespontcommand 1.05928 0.19147 5.532 3.16e-08 *** Modetonguetwister -0.10428 0.20619 -0.506 0.613032 Alcna -0.20571 0.05334 -3.857 0.000115 *** GM 0.21557 0.16157 1.334 0.182134 Alcna:GM 0.20224 0.07065 2.863 0.004201 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Correlation of Fixed Effects: (Intr) Moddlg Mdmnlg Mdspnt Mdtngt Alcna GM Modedialogu -0.793 Modemonolog -0.791 0.901 Mdspntcmmnd -0.699 0.798 0.796 Modtngtwstr -0.645 0.740 0.738 0.657 Alcna -0.164 -0.012 0.000 0.005 -0.005 GM -0.411 0.009 0.009 0.002 0.000 0.203 Alcna:GM 0.129 0.001 -0.004 -0.004 0.000 -0.755 -0.283 > print(alc.lmer5, corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: as.matrix(alc[, 1:2]) ~ Mode + Alc * G + (1 | Vpn) + (1 | Mode:Vpn) Data: alc AIC BIC logLik deviance 1521 1569 -750.3 1501 Random effects: Groups Name Variance Std.Dev. Mode:Vpn (Intercept) 0.19221 0.43841 Vpn (Intercept) 0.46033 0.67848 Number of obs: 960, groups: Mode:Vpn, 480; Vpn, 96 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -6.15088 0.19503 -31.537 < 2e-16 *** Modedialogue 2.08696 0.17029 12.255 < 2e-16 *** Modemonologue 2.07366 0.17067 12.150 < 2e-16 *** Modespontcommand 1.05928 0.19147 5.532 3.16e-08 *** Modetonguetwister -0.10428 0.20619 -0.506 0.613032 Alcna -0.20571 0.05334 -3.857 0.000115 *** GM 0.21557 0.16157 1.334 0.182134 Alcna:GM 0.20224 0.07065 2.863 0.004201 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > anova(alc.lmer5) Error in anova(alc.lmer5) : single argument anova for GLMMs not yet implemented > print(alc.lmer5 <- lmer(as.matrix(alc[, 1:2]) ~ 0 + Mode + Alc * G + (1 | Vpn) + (1 | Mode:Vpn), data=alc, family=binomial), corr=F) Generalized linear mixed model fit by the Laplace approximation Formula: as.matrix(alc[, 1:2]) ~ 0 + Mode + Alc * G + (1 | Vpn) + (1 | Mode:Vpn) Data: alc AIC BIC logLik deviance 1521 1569 -750.3 1501 Random effects: Groups Name Variance Std.Dev. Mode:Vpn (Intercept) 0.19221 0.43842 Vpn (Intercept) 0.46034 0.67849 Number of obs: 960, groups: Mode:Vpn, 480; Vpn, 96 Fixed effects: Estimate Std. Error z value Pr(>|z|) Modeadresses -6.15088 0.19504 -31.54 < 2e-16 *** Modedialogue -4.06391 0.11991 -33.89 < 2e-16 *** Modemonologue -4.07722 0.12032 -33.89 < 2e-16 *** Modespontcommand -5.09160 0.15008 -33.93 < 2e-16 *** Modetonguetwister -6.25516 0.16931 -36.94 < 2e-16 *** Alcna -0.20571 0.05334 -3.86 0.000115 *** GM 0.21558 0.16157 1.33 0.182131 Alcna:GM 0.20225 0.07065 2.86 0.004198 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > head(alc) hes_number hes_restsylnumber Alc G Mode Vpn 1 1 276 a F monologue s006 2 7 316 a F dialogue s006 3 0 99 a F tonguetwister s006 4 0 58 a F adresses s006 5 3 63 a F spontcommand s006 6 6 465 na F monologue s006 > with(alc, table(Mode, Alc)) Alc Mode a na adresses 96 96 dialogue 96 96 monologue 96 96 spontcommand 96 96 tonguetwister 96 96 > with(alc, table(Mode, Alc, G)) , , G = F Alc Mode a na adresses 50 50 dialogue 50 50 monologue 50 50 spontcommand 50 50 tonguetwister 50 50 , , G = M Alc Mode a na adresses 46 46 dialogue 46 46 monologue 46 46 spontcommand 46 46 tonguetwister 46 46 > head(alc) hes_number hes_restsylnumber Alc G Mode Vpn 1 1 276 a F monologue s006 2 7 316 a F dialogue s006 3 0 99 a F tonguetwister s006 4 0 58 a F adresses s006 5 3 63 a F spontcommand s006 6 6 465 na F monologue s006 >