Getting data

Let temperature be x1

Let Oil be x2

Let Time be x3

Let no of inedible kernel be y

x1 <- c(7,5,7,7,6,6,5,6,5,6,5,7,6,6,6) 
x2 <- c(4,3,3,2,4,3,3,2,4,2,2,3,3,3,4)
x3 <- c(90,105,105,90,105,90,75,105,90,75,90,75,90,90,75)
y <- c(24,28,40,42,11,16,126,34,32,32,34,17,30,17,50)
dat <- data.frame(x1,x2,x3,y)

This summary gave beta parameters as follows

Beta 0 8.24

Beta 1 -0.346247

beta 2 -0.088511

beta 3 -0.026742

Q3) 3. Compare the model deviances between questions 1 and 2, which would you choose?

deviance_model1 <- 213.45-  133.38
deviance_model2 <-213.45 - 157.17
deviance_model1
## [1] 80.07
deviance_model2
## [1] 56.28

Q4) 4. For the model of question 3, what is the estimated mean number of unpopped kernels when Temperature is 5, Oil is 3, and Time is 90?

X1 <- c(5)
X2 <- c(3)
X3 <- c(90)
pred <- predict(model,data.frame(x1=X1,x2=X2,x3=X3),type = "response")
pred
##        1 
## 46.54296

Hence 46.54296 is estimated mean number of unpopped kernels when Temperature is 5, Oil is 3, and Time is 90

Q5) For the model of question 4, what is the estimated probability that there will be less or equal to 30 unpopped kernels when Temperature is 5, Oil is 3, and Time is 90?

ppois(q = 30,lambda = 46.54296 )
## [1] 0.006484191

0.6484191 % estimated probability that there will be less or equal to 30 unpopped kernels when Temperature is 5, Oil is 3, and Time is 90