a.
b. From above plot, we see that as bottle no. increases, amount of soft drink decreases. Since correlation coefficient between two variables=-0.9725 which is very strong negative correlation. Hence we can consider these two variables are linearly associated.
c. Predicted amount of soft drink filled in the next bottle=1.925
R code:
y=c(2.109,2.086,2.066,2.075,2.065,2.057,2.052,2.044,2.036,2.038,2.031,2.029,
2.025,2.029,2.023,2.020,2.015,2.014,2.013,2.014,2.012,2.012,2.012,2.010,2.005,
2.003,1.999,1.996,1.997,1.992,1.994,1.986,1.984,1.981,1.973,1.975,1.971,1.969,
1.966,1.967,1.963,1.957,1.951,1.951,1.947,1.941,1.941,1.938,1.908,1.894)
plot(y,type ="o",col="2",xlab="bottle number",ylab="Amount of soft
drink")#(a)
x=1:50
round(cor(x,y),4)#(b)
m=lm(y~x)
new=data.frame(x=51)
round(predict(m,new),3)#(c)
Get Answers For Free
Most questions answered within 1 hours.