{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Rforch25 - R Material for Chapter 25 > data.tours...

This preview shows pages 1–3. Sign up to view the full content.

R Material for Chapter 25 > data.tours <- read.table(file=" http://www.stat.ufl.edu/~rrandles/sta4211/Rclassnotes/data/tours.txt ",col.n ames=c("time","guide","trip")) > attach(data.tours) > data.tours time guide trip 1 37 1 1 2 31 1 2 3 33 1 3 4 30 1 4 5 39 1 5 6 31 1 6 7 36 2 1 8 33 2 2 9 38 2 3 10 36 2 4 11 37 2 5 12 39 2 6 13 38 3 1 14 38 3 2 15 39 3 3 16 36 3 4 17 38 3 5 18 37 3 6 19 30 4 1 20 34 4 2 21 31 4 3 22 30 4 4 23 35 4 5 24 34 4 6 > fguide <- factor(guide) > model1 <- aov(time~fguide) > summary(model1) Df Sum Sq Mean Sq F value Pr(>F) fguide 3 112.33 37.444 6.2581 0.003592 ** Residuals 20 119.67 5.983 --- Signif. Codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > tapply(time,fguide,mean) 1 2 3 4 33.50000 36.50000 37.66667 32.33333 > tapply(time,fguide,var) 1 2 3 4 13.500000 4.300000 1.066667 5.066667

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
> data.mpg <- read.table(file=" http://www.stat.ufl.edu/~rrandles/sta4211/Rclassnotes/data/mpg.txt ",col.nam es=c("miles","driver","car","rep")) > attach(data.mpg) > data.mpg miles driver car rep 1 25.3 1 1 1 2 25.2 1 1 2 3 28.9 1 2 1 4 30.0 1 2 2 5 24.8 1 3 1 6 25.1 1 3 2 7 28.4 1 4 1 8 27.9 1 4 2 9 27.1 1 5 1 10 26.6 1 5 2 11 33.6 2 1 1 12 32.9 2 1 2 13 36.7 2 2 1 14 36.5 2 2 2 15 31.7 2 3 1 16 31.9 2 3 2 17 35.6 2 4 1 18 35.0 2 4 2 19 33.7 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}