C:\Rmisc>C:\Progra~1\R\R-2.3.1\bin\Rterm --vanilla R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.1 (2006-06-01) 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("trombone.pdf") > > trombone1 <- read.fwf("C:\\data\\trombone.dat", width=c(8,8,8,8,8,8,8,8,8,8,8), + col.names=c("trt", "x", "y","pp","mp","cp","mps","ppx","mpx","cpx","mpsx")) > > attach(trombone1) > > trt <- factor(trt, levels=1:5, + labels=c("pp", "mp", "cp", "mps","control")) > > > tapply(y, trt, mean) # marginal mean for y pp mp cp mps control 28.83333 27.83333 30.33333 28.66667 26.33333 > tapply(x, trt, mean) # marginal mean for x pp mp cp mps control 23.00000 25.16667 22.00000 25.00000 25.66667 > > mean(x) [1] 24.16667 > > # Fit Model with Interaction > trombone1.aov <- lm(y ~ x + pp + mp + cp + mps + ppx + mpx + cpx +mpsx) > > summary(trombone1.aov) Call: lm(formula = y ~ x + pp + mp + cp + mps + ppx + mpx + cpx + mpsx) Residuals: Min 1Q Median 3Q Max -4.91603 -1.25269 -0.03757 1.08845 3.01908 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -4.1336 6.0508 -0.683 0.5023 x 1.1870 0.2332 5.091 5.58e-05 *** pp 17.6575 6.7271 2.625 0.0162 * mp 15.0516 9.8270 1.532 0.1413 cp 13.2526 10.9310 1.212 0.2395 mps 16.9400 7.3048 2.319 0.0311 * ppx -0.5214 0.2631 -1.982 0.0614 . mpx -0.5149 0.3844 -1.339 0.1955 cpx -0.2227 0.4733 -0.471 0.6430 mpsx -0.5526 0.2827 -1.955 0.0647 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.179 on 20 degrees of freedom Multiple R-Squared: 0.8225, Adjusted R-squared: 0.7427 F-statistic: 10.3 on 9 and 20 DF, p-value: 9.164e-06 > > # Fit Model without Interaction > trombone2.aov <- lm(y ~ x + pp + mp + cp + mps) > > summary(trombone2.aov) Call: lm(formula = y ~ x + pp + mp + cp + mps) Residuals: Min 1Q Median 3Q Max -4.41557 -0.78550 -0.05736 1.15597 4.20779 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.39995 2.37356 3.118 0.00468 ** x 0.73766 0.08549 8.628 8.07e-09 *** pp 4.46710 1.29984 3.437 0.00215 ** mp 1.86883 1.28041 1.460 0.15738 cp 6.70477 1.31753 5.089 3.32e-05 *** mps 2.82511 1.28096 2.205 0.03725 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.216 on 24 degrees of freedom Multiple R-Squared: 0.7797, Adjusted R-squared: 0.7338 F-statistic: 16.99 on 5 and 24 DF, p-value: 3.371e-07 > > # Fit Model without treatment effects > trombone3.aov <- lm(y ~ x) > > summary(trombone3.aov) Call: lm(formula = y ~ x) Residuals: Min 1Q Median 3Q Max -8.2457 -1.7272 0.4491 2.0360 4.3123 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 13.6458 2.7901 4.891 3.74e-05 *** x 0.6105 0.1131 5.397 9.37e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.061 on 28 degrees of freedom Multiple R-Squared: 0.5099, Adjusted R-squared: 0.4924 F-statistic: 29.13 on 1 and 28 DF, p-value: 9.368e-06 > > > dev.off() null device 1 >