Rforch26 - 2 38 27 3 2 3 39 31 3 2 4 40 23 3 2 5 41 16 3 3...

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

View Full Document Right Arrow Icon
R Material for Chapter 26 > data.health <- read.table(file="http://www.stat.ufl.edu/~rrandles/sta4211/Rclassnotes/data/health.txt",col. names=c("aware","state","city","house")) > attach(data.health) > data.health aware state city house 1 42 1 1 1 2 56 1 1 2 3 35 1 1 3 4 40 1 1 4 5 28 1 1 5 6 26 1 2 1 7 38 1 2 2 8 42 1 2 3 9 35 1 2 4 10 53 1 2 5 11 34 1 3 1 12 51 1 3 2 13 60 1 3 3 14 29 1 3 4 15 44 1 3 5 16 47 2 1 1 17 58 2 1 2 18 39 2 1 3 19 62 2 1 4 20 65 2 1 5 21 56 2 2 1 22 43 2 2 2 23 65 2 2 3 24 70 2 2 4 25 59 2 2 5 26 68 2 3 1 27 51 2 3 2 28 49 2 3 3 29 71 2 3 4 30 57 2 3 5 31 19 3 1 1 32 36 3 1 2 33 24 3 1 3 34 12 3 1 4 35 33 3 1 5 36 18 3 2 1 37 40 3 2
Background image of page 1

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

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

Unformatted text preview: 2 38 27 3 2 3 39 31 3 2 4 40 23 3 2 5 41 16 3 3 1 42 28 3 3 2 43 45 3 3 3 44 30 3 3 4 45 21 3 3 5 &gt; fstate &lt;- factor(state) &gt; fcity &lt;- factor(city) &gt; model1 &lt;- aov(aware~fstate + fstate:fcity) &gt; summary(model1) Df Sum Sq Mean Sq F value Pr(&gt;F) fstate 2 6976.8 3488.4 32.2571 9.405e-09 *** fstate:fcity 6 167.6 27.9 0.2583 0.9526 Residuals 36 3893.2 108.1 --- Signif. Codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 &gt; tapply(aware,fstate,mean) 1 2 3 40.86667 57.33333 26.86667 &gt; tapply(aware,fstate:fcity,mean) 1:1 1:2 1:3 2:1 2:2 2:3 3:1 3:2 3:3 40.2 38.8 43.6 54.2 58.6 59.2 24.8 27.8 28.0 &gt; qtukey(.95,3,36)*sqrt(108.1/15) [1] 9.279749...
View Full Document

This note was uploaded on 07/08/2011 for the course STA 4211 taught by Professor Randles during the Spring '08 term at University of Florida.

Page1 / 2

Rforch26 - 2 38 27 3 2 3 39 31 3 2 4 40 23 3 2 5 41 16 3 3...

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