Rforch19 - R Material for Chapter 19 > data.orangetree

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

View Full Document Right Arrow Icon
R Material for Chapter 19 > data.orangetree <- read.table(file="http://www.stat.ufl.edu/~rrandles/sta4211/Rclassnotes/data/orangetree.txt", col.names=c("growth","ph","calcium")) > attach(data.orangetree) > data.orangetree ## data set on orange tree truck growth growth ph calcium 1 5.2 4 100 2 5.9 4 100 3 6.3 4 100 4 7.4 4 200 5 7.0 4 200 6 7.6 4 200 7 6.3 4 300 8 6.7 4 300 9 6.1 4 300 10 7.1 5 100 11 7.4 5 100 12 7.5 5 100 13 7.4 5 200 14 7.3 5 200 15 7.1 5 200 16 7.3 5 300 17 7.5 5 300 18 7.2 5 300 19 7.6 6 100 20 7.2 6 100 21 7.4 6 100 22 7.6 6 200 23 7.5 6 200 24 7.8 6 200 25 7.2 6 300 26 7.3 6 300 27 7.0 6 300 > fph <- factor(ph) ## make ph a factor > fcalcium <- factor(calcium) ## make calcium a factor > model <- aov(growth~ fph +fcalcium +fph:fcalcium,data=data.orangetree) > summary(model) Df Sum Sq Mean Sq F value Pr(>F) fph 2 4.4274 2.21370 29.589 2.042e-06 *** ## ANOVA Table fcalcium 2 1.6230 0.81148 10.847 0.0008110 *** fph:fcalcium 4 2.3193 0.57981 7.750 0.0008154 *** Residuals 18 1.3467 0.07481 --- Signif. Codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > mt <- with(model,tapply(growth,fph:fcalcium,mean)) ## the individual cell means for all ## combinations of the two factors > mt 4:100 4:200 4:300 5:100 5:200 5:300 6:100 6:200 5.800000 7.333333 6.366667 7.333333 7.266667 7.333333 7.400000 7.633333 6:300 7.166667
Background image of page 1

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

View Full DocumentRight Arrow Icon
> tukeydiff <- TukeyHSD(model,conf.level=.90)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Rforch19 - R Material for Chapter 19 &gt; data.orangetree

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

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