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("oehemp4_3.pdf") > > > leaflet <- matrix(c( + 1, 140, + 1, 138, + 1, 140, + 1, 138, + 1, 142, + 2, 140, + 2, 150, + 2, 120, + 2, 128, + 2, 130, + 3, 118, + 3, 130, + 3, 128, + 3, 118, + 3, 118), ncol=2, byrow=T) > > > angle <- leaflet[,2] > delay <- leaflet[,1] > delayf <- C(factor(delay),contr=contr.poly,scores=sort(unique(delay))) > > delay [1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 > angle [1] 140 138 140 138 142 140 150 120 128 130 118 130 128 118 118 > delayf [1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 attr(,"contrasts") .L .Q 1 -7.071068e-01 0.4082483 2 -9.073264e-17 -0.8164966 3 7.071068e-01 0.4082483 Levels: 1 2 3 > > tapply(angle, delayf, mean) 1 2 3 139.6 133.6 122.4 > tapply(angle, delayf, sd) 1 2 3 1.67332 11.61034 6.06630 > > contr.poly(3) .L .Q [1,] -7.071068e-01 0.4082483 [2,] -9.073264e-17 -0.8164966 [3,] 7.071068e-01 0.4082483 > > angle.aov <- aov(angle ~ delayf) > > summary(angle.aov, split=list(delayf=list(linear=1,quadratic=2))) Df Sum Sq Mean Sq F value Pr(>F) delayf 2 762.13 381.07 6.5550 0.011912 * delayf: linear 1 739.60 739.60 12.7225 0.003875 ** delayf: quadratic 1 22.53 22.53 0.3876 0.545205 Residuals 12 697.60 58.13 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > > angle2.aov <- aov(angle ~ delay + I(delay^2)) > > summary(angle2.aov) Df Sum Sq Mean Sq F value Pr(>F) delay 1 739.60 739.60 12.7225 0.003875 ** I(delay^2) 1 22.53 22.53 0.3876 0.545205 Residuals 12 697.60 58.13 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > > dev.off() null device 1 >