C:\Rmisc>C:\R-2.9.0\bin\Rterm --vanilla R version 2.9.0 (2009-04-17) Copyright (C) 2009 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. > pdf("crssovr.pdf") > > milkcow <- read.fwf("C:\\data\\EMP13-12a_dat", width=c(rep(8,9)), + col.names=c("cow", "rep", "trt","trt1","trt2","res1","res2","milk","logmilk")) > > attach(milkcow) > > cow <- factor(cow, levels=1:18) > > rep <- factor(rep, levels=1:3) > > trt <- factor(trt, levels=1:3) > > > milkcow1.aov <- lm(logmilk ~ cow + rep + trt) > > summary(milkcow1.aov) Call: lm(formula = logmilk ~ cow + rep + trt) Residuals: Min 1Q Median 3Q Max -0.149539 -0.031840 -0.003086 0.042164 0.111622 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.17737 0.04446 161.440 < 2e-16 *** cow2 0.33667 0.05687 5.920 1.37e-06 *** cow3 0.30367 0.05687 5.340 7.40e-06 *** cow4 0.29490 0.05687 5.185 1.16e-05 *** cow5 0.15767 0.05687 2.772 0.00920 ** cow6 0.17183 0.05687 3.021 0.00492 ** cow7 0.18423 0.05687 3.239 0.00279 ** cow8 0.18017 0.05687 3.168 0.00337 ** cow9 0.13613 0.05687 2.394 0.02271 * cow10 0.10920 0.05687 1.920 0.06379 . cow11 0.12660 0.05687 2.226 0.03318 * cow12 0.09937 0.05687 1.747 0.09019 . cow13 0.06257 0.05687 1.100 0.27948 cow14 -0.07153 0.05687 -1.258 0.21756 cow15 0.01383 0.05687 0.243 0.80937 cow16 -0.07207 0.05687 -1.267 0.21423 cow17 -0.11740 0.05687 -2.064 0.04717 * cow18 -0.03443 0.05687 -0.605 0.54915 rep2 -0.14026 0.02322 -6.041 9.64e-07 *** rep3 -0.33169 0.02322 -14.286 1.94e-15 *** trt2 0.13149 0.02322 5.664 2.88e-06 *** trt3 0.21136 0.02322 9.103 2.14e-10 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.06965 on 32 degrees of freedom Multiple R-squared: 0.9372, Adjusted R-squared: 0.8959 F-statistic: 22.73 on 21 and 32 DF, p-value: 1.100e-13 > > aov(milkcow1.aov) Call: aov(formula = milkcow1.aov) Terms: cow rep trt Residuals Sum of Squares 0.9072192 0.9980500 0.4100385 0.1552499 Deg. of Freedom 17 2 2 32 Residual standard error: 0.06965313 Estimated effects may be unbalanced > > milkcow2.aov <- lm(logmilk ~ cow + rep + trt + res1 + res2) > > summary(milkcow2.aov) Call: lm(formula = logmilk ~ cow + rep + trt + res1 + res2) Residuals: Min 1Q Median 3Q Max -0.1664569 -0.0342934 0.0001660 0.0343347 0.0960014 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.178011 0.041073 174.761 < 2e-16 *** cow2 0.306053 0.053025 5.772 2.64e-06 *** cow3 0.287393 0.053025 5.420 7.12e-06 *** cow4 0.278626 0.053025 5.255 1.14e-05 *** cow5 0.157667 0.051954 3.035 0.00494 ** cow6 0.141219 0.053025 2.663 0.01233 * cow7 0.184233 0.051954 3.546 0.00131 ** cow8 0.149553 0.053025 2.820 0.00842 ** cow9 0.119860 0.053025 2.260 0.03121 * cow10 0.092926 0.053025 1.752 0.08991 . cow11 0.126600 0.051954 2.437 0.02097 * cow12 0.068753 0.053025 1.297 0.20465 cow13 0.062567 0.051954 1.204 0.23790 cow14 -0.102147 0.053025 -1.926 0.06358 . cow15 -0.002440 0.053025 -0.046 0.96360 cow16 -0.088340 0.053025 -1.666 0.10612 cow17 -0.117400 0.051954 -2.260 0.03126 * cow18 -0.065047 0.053025 -1.227 0.22947 rep2 -0.140256 0.021210 -6.613 2.55e-07 *** rep3 -0.331694 0.021210 -15.638 5.76e-16 *** trt2 0.145835 0.023714 6.150 9.18e-07 *** trt3 0.241969 0.023714 10.204 2.85e-11 *** res1 -0.044954 0.018369 -2.447 0.02046 * res2 -0.001933 0.018369 -0.105 0.91688 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.06363 on 30 degrees of freedom Multiple R-squared: 0.9508, Adjusted R-squared: 0.9131 F-statistic: 25.23 on 23 and 30 DF, p-value: 7.31e-14 > > aov(milkcow2.aov) Call: aov(formula = milkcow2.aov) Terms: cow rep trt res1 res2 Residuals Sum of Squares 0.9072192 0.9980500 0.4100385 0.0337396 0.0000449 0.1214655 Deg. of Freedom 17 2 2 1 1 30 Residual standard error: 0.06363057 Estimated effects may be unbalanced > > milkcow3.aov <- lm(logmilk ~ cow + rep + trt1 + trt2 + res1 + res2) > > summary(milkcow3.aov) Call: lm(formula = logmilk ~ cow + rep + trt1 + trt2 + res1 + res2) Residuals: Min 1Q Median 3Q Max -0.1664569 -0.0342934 0.0001660 0.0343347 0.0960014 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.307279 0.039205 186.385 < 2e-16 *** cow2 0.306053 0.053025 5.772 2.64e-06 *** cow3 0.287393 0.053025 5.420 7.12e-06 *** cow4 0.278626 0.053025 5.255 1.14e-05 *** cow5 0.157667 0.051954 3.035 0.00494 ** cow6 0.141219 0.053025 2.663 0.01233 * cow7 0.184233 0.051954 3.546 0.00131 ** cow8 0.149553 0.053025 2.820 0.00842 ** cow9 0.119860 0.053025 2.260 0.03121 * cow10 0.092926 0.053025 1.752 0.08991 . cow11 0.126600 0.051954 2.437 0.02097 * cow12 0.068753 0.053025 1.297 0.20465 cow13 0.062567 0.051954 1.204 0.23790 cow14 -0.102147 0.053025 -1.926 0.06358 . cow15 -0.002440 0.053025 -0.046 0.96360 cow16 -0.088340 0.053025 -1.666 0.10612 cow17 -0.117400 0.051954 -2.260 0.03126 * cow18 -0.065047 0.053025 -1.227 0.22947 rep2 -0.140256 0.021210 -6.613 2.55e-07 *** rep3 -0.331694 0.021210 -15.638 5.76e-16 *** trt1 -0.129268 0.013691 -9.442 1.71e-10 *** trt2 0.016567 0.013691 1.210 0.23572 res1 -0.044954 0.018369 -2.447 0.02046 * res2 -0.001933 0.018369 -0.105 0.91688 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.06363 on 30 degrees of freedom Multiple R-squared: 0.9508, Adjusted R-squared: 0.9131 F-statistic: 25.23 on 23 and 30 DF, p-value: 7.31e-14 > > aov(milkcow3.aov) Call: aov(formula = milkcow3.aov) Terms: cow rep trt1 trt2 res1 res2 Sum of Squares 0.9072192 0.9980500 0.4020405 0.0079980 0.0337396 0.0000449 Deg. of Freedom 17 2 1 1 1 1 Residuals Sum of Squares 0.1214655 Deg. of Freedom 30 Residual standard error: 0.06363057 Estimated effects may be unbalanced > > > dev.off() null device 1 >