ex1rev - R Material for First Exam Review > data.union

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
> data.union <- read.table(file="http://www.stat.ufl.edu/~rrandles/sta4211/Rclassnotes/data/union.txt",col.n ames=c("union","incent","prod")) > attach(data.union) > data.union union incent prod 1 yes A 337 2 yes A 362 3 yes A 305 4 yes B 346 5 yes B 351 6 yes B 355 7 yes C 317 8 yes C 335 9 yes C 310 10 no A 359 11 no A 345 12 no A 381 13 no B 371 14 no B 352 15 no B 399 16 no C 350 17 no C 349 18 no C 374 > funion <- factor(union) > fincent <- factor(incent) > model1 <- aov(prod~funion + fincent +funion:fincent) > summary(model1) Df Sum Sq Mean Sq F value Pr(>F) funion 1 3813.6 3813.6 10.9393 0.006254 ** fincent 2 1636.8 818.4 2.3476 0.137895 funion:fincent 2 150.1 75.1 0.2153 0.809348 Residuals 12 4183.3 348.6 --- Signif. Codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > tapply(prod,funion:fincent,mean) no:A no:B no:C yes:A yes:B yes:C 361.6667 374.0000 357.6667 334.6667 350.6667 320.6667 > tapply(prod,funion,mean) no yes 364.4444 335.3333
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

ex1rev - R Material for First Exam Review &gt; data.union

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online