> glucose.mod1 <- aov(glucose ~ conc + day + conc:day + day/run + conc:day/run) > summary(glucose.mod1) Df Sum Sq Mean Sq F value Pr(>F) conc 2 108264 54132 37693.3290 < 2.2e-16 *** day 2 25 12 8.6613 0.002317 ** conc:day 4 176 44 30.7073 8.057e-08 *** day:run 3 263 88 61.0689 1.240e-09 *** conc:day:run 6 180 30 20.9153 3.330e-07 *** Residuals 18 26 1 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > glucose.mod2 <- aov(glucose ~ conc + day + conc:day + day/run + Error(conc:day/run)) Warning message: In aov(glucose ~ conc + day + conc:day + day/run + Error(conc:day/run)) : Error() model is singular > summary(glucose.mod2) Error: conc:day Df Sum Sq Mean Sq conc 2 108264 54132 day 2 25 12 conc:day 4 176 44 Error: conc:day:run Df Sum Sq Mean Sq F value Pr(>F) day:run 3 263.11 87.702 2.9198 0.1223 Residuals 6 180.22 30.037 Error: Within Df Sum Sq Mean Sq F value Pr(>F) Residuals 18 25.85 1.4361 > > library(nlme) > > glucose.mod3 <- lme(fixed=glucose~conc,random=~1|conc/day/run) > summary(glucose.mod3) Linear mixed-effects model fit by REML Data: NULL AIC BIC logLik 178.0282 188.5038 -82.01411 Random effects: Formula: ~1 | conc (Intercept) StdDev: 0.9224093 Formula: ~1 | day %in% conc (Intercept) StdDev: 0.0004076642 Formula: ~1 | run %in% day %in% conc (Intercept) Residual StdDev: 4.557253 1.198379 Fixed effects: glucose ~ conc Value Std.Error DF t-value p-value (Intercept) 42.15000 2.105218 18 20.02168 0 conc2 94.40833 2.977227 0 31.71015 NaN conc3 129.95833 2.977227 0 43.65080 NaN Correlation: (Intr) conc2 conc2 -0.707 conc3 -0.707 0.500 Standardized Within-Group Residuals: Min Q1 Med Q3 Max -1.95735317 -0.36408898 -0.01036915 0.42462622 1.71427468 Number of Observations: 36 Number of Groups: conc day %in% conc run %in% day %in% conc 3 9 18 Warning message: In pt(q, df, lower.tail, log.p) : NaNs produced > anova(glucose.mod3) numDF denDF F-value p-value (Intercept) 1 18 9256.466 <.0001 conc 2 0 1017.835 NaN Warning message: In pf(q, df1, df2, lower.tail, log.p) : NaNs produced > > 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:nlme': BIC, lmList, VarCorr The following object(s) are masked from 'package:stats': AIC Warning message: package 'lme4' was built under R version 2.12.1 > > glucose.mod4 <- lmer(glucose~conc+(1|conc:day)+(1|run:day)+(1|day/conc:run)) > summary(glucose.mod4) Linear mixed model fit by REML Formula: glucose ~ conc + (1 | conc:day) + (1 | run:day) + (1 | day/conc:run) AIC BIC logLik deviance REMLdev 179.6 192.3 -81.81 172.8 163.6 Random effects: Groups Name Variance Std.Dev. conc:run:day (Intercept) 1.7113e+01 4.1368e+00 conc:day (Intercept) 7.2637e-08 2.6951e-04 run:day (Intercept) 3.6557e+00 1.9120e+00 day (Intercept) 9.6312e-14 3.1034e-07 Residual 1.4361e+00 1.1984e+00 Number of obs: 36, groups: conc:run:day, 18; conc:day, 9; run:day, 6; day, 3 Fixed effects: Estimate Std. Error t value (Intercept) 42.150 1.892 22.27 conc2 94.408 2.438 38.72 conc3 129.958 2.438 53.31 Correlation of Fixed Effects: (Intr) conc2 conc2 -0.644 conc3 -0.644 0.500 > anova(glucose.mod4) Analysis of Variance Table Df Sum Sq Mean Sq F value conc 2 4359.8 2179.9 1517.9