############################## # # Script for Assignment 14 # ############################## # Problem 14.1 # This problem is just interpreting the ANOVA table # Problem 14.2 c05 <- c(1.62, 1.60, 1.62, 1.66) c10 <- c(2.69, 2.66, 2.72, 2.73) c15 <- c(3.56, 3.45, 3.65, 3.52) c20 <- c(3.35, 3.18, 3.40, 3.06) enthalpy <- c(c05, c10, c15, c20) concentration <- as.factor( c(rep(5,4), rep(10,4), rep(15,4), rep(20,4)) ) m14.2 <- aov(enthalpy~concentration) summary( m14.2 ) pairwise.t.test(enthalpy,concentration, p.adjust.method="bonferroni") TukeyHSD(m14.2) # Problem 14.3 crime <- read.csv("http://oforsber.kvasaheim.com/courses/stat4073/data/crime.csv", header=TRUE) vcrime <- crime$vcrime90 region <- crime$census4 mean(vcrime) m14.3 <- aov(vcrime~region) summary(m14.3) png("figure143.png", height=500, width=600) boxplot(vcrime~region, ylab="Violent Crime Rate (1990)") dev.off() TukeyHSD(m14.3) # Problem 14.4 joints <- read.csv("problem144.csv", header=TRUE) names(joints) attach(joints) m144 <- aov(cof~taper*length) summary(m144) mean(cof) mean(cof[taper=="CPTi-ZrO2"]) mean(cof[taper=="TiAlloy-ZrO2"]) mean(cof[length=="short"]) mean(cof[length=="medium"]) mean(cof[length=="long"]) TukeyHSD(m144) t.test(cof[length=="short"], cof[length=="medium"] )$p.value t.test(cof[length=="short"], cof[length=="long"] )$p.value t.test(cof[length=="medium"], cof[length=="long"] )$p.value