#Problem 14
#(a)
data <- read.table("p14.txt")
stem(data$V1)
##
## The decimal point is at the |
##
## 2 | 23
## 3 | 2344567789
## 4 | 01356889
## 5 | 00001114455666789
## 6 | 0000122223344456667789999
## 7 | 00012233455555668
## 8 | 02233448
## 9 | 012233335666788
## 10 | 2344455688
## 11 | 2335999
## 12 | 37
## 13 | 8
## 14 | 36
## 15 | 0035
## 16 |
## 17 |
## 18 | 9
#(b)
#It looks to be concentrated around 6 (around 6 and 7)
mean(data$V1)
## [1] 7.707752
median(data$V1)
## [1] 7
#(c)
#The data is concentrated towards the lower end of the scale.
#(d)
#Mostly symmetric, however there is some astmetry; a longer tail
#(e)
#18.9 is definitely an outlier.
#Problem 18
x <- c(4:17,21,24,32)
y <- c(3,12,13,25,24,42,23,19,16,11,5,4,1,3,1,1,1)
#(a)
barplot(y, names.arg=x, las=2)
#(b)
x <- c(4:17, ">=18")
y <- c(3,12,13,25,24,42,23,19,16,11,5,4,1,3,3)
barplot(y, names.arg=x, las=2)
#No, because there is no data on the frequency of 21, 24 and 32
#(c), (d)
x <- 4:17
x <- c(x,21,24,32)
y <- c(3,12,13,25,24,42,23,19,16,11,5,4,1,3,1,1,1)
sum((x <= 10)*y)/204*100 #part c (%)
## [1] 69.60784
sum((x > 15)*y)/204*100 #part d (%)
## [1] 3.431373
#Problem 34
u <- c(6,5,11,33,4,5,80,18,35,17,23) #Urban
f <- c(4,14,11,9,9,8,4,20,5,8.9,21,9.2,3,2,0.3) #Farm
#(a)
mean(u)
## [1] 21.54545
mean(f)
## [1] 8.56
#The average concentration is much higher in urban
#(b)
median(u)
## [1] 17
median(f)
## [1] 8.9
u <- sort(u)
f <- sort(f)
#(c)
mean(u[2:length(u)-1])
## [1] 15.7
mean(f[2:length(f)-1])
## [1] 7.671429
(1/length(u))*100
## [1] 9.090909
(1/length(f))*100
## [1] 6.666667
#Problem 58 # Machine 1 has an outlier # The medians for both are at the same point, their typical values seem to be the same # Machine 2 is more spread out, which means that it has more variation.