12.07.2015 Views

R dummies

R dummies

R dummies

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

str(InsectSprays)‘data.frame’: 72 obs. of 2 variables:$ count: num 10 7 20 14 14 12 10 23 17 20 ...$ spray: Factor w/ 6 levels “A”,”B”,”C”,”D”,..: 1 1 1 1 1 1 1 1 1 1 ...This dataset contains the results of an agricultural experiment. Six insecticideswere tested on 12 fields each, and the researchers counted the number of peskybugs that remained on each field. Now the farmers need to know if the insecticidesmake any difference, and if so, which one they best use. You answer this questionby using the aov() function to perform an ANOVA.Building the modelFor this simple example, building the model is a piece of cake. You essentiallywant to model the means for the variable count as a function of the variable spray.You translate that to R like this:> AOVModel

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!