> heat<-read.table("24ON.txt",header=T) > attach(heat) > heat egg sperm genotype normal abnormal treatment batch 1 51 52 1 264 80 1 1107125152 2 51 52 1 114 57 2 1107125152 3 62 63 1 513 3 1 6263 4 62 63 1 30 134 2 6263 5 85 86 1 179 13 1 1108248586 6 85 86 1 336 71 2 1108248586 7 87 89 1 200 3 1 1108248789 8 87 89 1 155 95 2 1108248789 9 88 87 1 339 32 1 1108248887 10 88 87 1 367 138 2 1108248887 11 97 96 1 46 3 1 1108249796 12 97 96 1 69 5 2 1108249796 13 119 120 1 121 65 1 119129 14 119 120 1 108 40 2 119129 15 120 119 1 221 3 1 120119 16 120 119 1 182 13 2 120119 17 7 11 2 259 122 1 1105180711 18 7 11 2 23 19 2 1105180711 19 8 11 2 89 13 1 1105180811 20 8 11 2 77 36 2 1105180811 21 51 48 2 264 20 1 1107125148 22 51 48 2 152 17 2 1107125148 23 51 49 2 126 31 1 1107125149 24 51 49 2 129 26 2 1107125149 25 52 49 2 177 25 1 1107125249 26 52 49 2 202 22 2 1107125249 27 62 64 2 168 0 1 6264 28 62 64 2 21 167 2 6264 29 109 106 2 233 22 1 109106 30 109 106 2 134 82 2 109106 31 115 112 2 70 4 1 115112 32 115 112 2 83 60 2 115112 33 119 116 2 163 17 1 119116 34 119 116 2 70 8 2 119116 35 119 117 2 105 14 1 119117 36 119 117 2 62 2 2 119117 37 64 62 3 346 0 1 6462 38 64 62 3 2 167 2 6462 39 68 66 3 145 14 1 6866 40 68 66 3 1 301 2 6866 41 70 67 3 148 1 1 7067 42 70 67 3 7 95 2 7067 43 71 67 3 175 0 1 7167 44 71 67 3 0 100 2 7167 45 105 109 3 316 188 1 105109 46 105 109 3 4 367 2 105109 47 112 115 3 176 93 1 112115 48 112 115 3 26 286 2 112115 49 118 120 3 304 5 1 118120 50 118 120 3 1 218 2 118120 51 30 31 4 148 24 1 1106143031 52 30 31 4 0 100 2 1106143031 53 31 32 4 383 143 1 1106143132 54 31 32 4 0 100 2 1106143132 55 43 47 4 352 62 1 1106224347 56 43 47 4 0 100 2 1106224347 57 46 45 4 101 73 1 1106224645 58 46 45 4 0 100 2 1106224645 59 46 47 4 216 63 1 1106224647 60 46 47 4 21 150 2 1106224647 61 48 50 4 172 35 1 1107124850 62 48 50 4 56 268 2 1107124850 63 49 50 4 47 15 1 1107124950 64 49 50 4 47 98 2 1107124950 65 57 56 4 358 6 1 1107135756 66 57 56 4 267 61 2 1107135756 67 58 57 4 177 0 1 1107135857 68 58 57 4 221 50 2 1107135857 69 61 60 4 102 0 1 1108176160 70 61 60 4 88 20 2 1108176160 71 68 69 4 225 40 1 6869 72 68 69 4 0 100 2 6869 73 83 84 4 308 17 1 1108248384 74 83 84 4 0 100 2 1108248384 75 84 83 4 100 0 1 1108248483 76 84 83 4 0 100 2 1108248483 77 91 92 4 253 38 1 1108249192 78 91 92 4 129 238 2 1108249192 79 105 106 4 357 108 1 105106 80 105 106 4 0 393 2 105106 81 111 112 4 128 12 1 111112 82 111 112 4 62 268 2 111112 83 112 113 4 255 15 1 112113 84 112 113 4 0 212 2 112113 85 117 118 4 271 36 1 117118 86 117 118 4 83 285 2 117118 > gen<-factor(genotype) > tre<-factor(treatment) > bat<-factor(batch) > library(lme4) Loading required package: Matrix Loading required package: lattice Attaching package: 'Matrix' The following object(s) are masked from 'package:base': det Attaching package: 'lme4' The following object(s) are masked from 'package:stats': AIC, BIC > y<-cbind(normal,abnormal) > model1<-lmer(y~tre*gen+(1|bat),binomial,data=heat,model="ML") > model2<-lmer(y~tre+gen+(1|bat),binomial,data=heat,model="ML") > anova(model1, model2, test="F") Data: heat Models: model2: y ~ tre + gen + (1 | bat) model1: y ~ tre * gen + (1 | bat) Df AIC BIC logLik Chisq Chi Df Pr(>Chisq) model2 6 2379.3 2394.0 -1183.63 model1 9 1447.5 1469.6 -714.74 937.78 3 < 2.2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE) + if(nchar(pkg)) library(pkg, character.only=TRUE)}) Loading required package: mvtnorm Loading required package: survival Loading required package: splines > summary(glht(model1,linfct=mcp(gen="Tukey"))) Simultaneous Tests for General Linear Hypotheses Multiple Comparisons of Means: Tukey Contrasts Fit: glmer(formula = y ~ tre * gen + (1 | bat), data = heat, family = binomial, model = "ML") Linear Hypotheses: Estimate Std. Error z value Pr(>|z|) 2 - 1 == 0 -0.51752 0.60318 -0.858 0.824 3 - 1 == 0 -0.17267 0.66040 -0.261 0.994 4 - 1 == 0 -0.20602 0.54003 -0.381 0.981 3 - 2 == 0 0.34485 0.62880 0.548 0.946 4 - 2 == 0 0.31150 0.50089 0.622 0.924 4 - 3 == 0 -0.03335 0.56849 -0.059 1.000 (Adjusted p values reported -- single-step method) Warning message: In mcp2matrix(model, linfct = linfct) : covariate interactions found -- default contrast might be inappropriate >