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

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

R Material for First Exam Review > 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 > tapply(prod,fincent,mean) A B C 348.1667 362.3333 339.1667 - - - - - - - - - - - - -

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern