Statistical Methods For Decision Making
Statistical Methods For Decision Making
Storage)
-Group 11(Raj,Navnath,Suraj,Shantanu)
Mean cold storage temperature for
Summer, Winter and Rainy Season
Code :
library(ggplot2)
df<-read.csv("Cold_Storage_Temp_Data.csv") #read the file and store in df
head(df)
summary(df)
Seas_Avg<-aggregate(df$Temperature,by=list(df$Season),FUN=mean)
colnames(Seas_Avg)<-c("Season","Average_temperature")
ggplot(Seas_Avg,aes(x=Season,y=Average_temperature))+geom_col(aes(fill=Seaso
n))+geom_text(aes(label=round(Average_temperature,2),hjust=0, vjust=-0.5))
Result
Overall mean for the full year
Code:
ggplot(df,aes(1:length(df$Temp
erature),df$Temperature))+geo
m_point(aes(col=Season))+geom
_line(aes(y=mean(df$Temperatu
re),col="Overall Average"))
+xlab("Index")+ylab("temperatur
e")
mean(df$Temperature)
Code :
ggplot(data =
normal,aes(x=Temperature,y=He
ight))+geom_line()+geom_line(ae
s(x=mean(df$Temperature),col="
Mean"))+geom_line(aes(x=mean(
df$Temperature)+sd(df$Tempera
ture),col="sd1"))+geom_line(aes(
x=mean(df$Temperature)-
sd(df$Temperature),col="sd-1"))
sd(df$Temperature)
Standard 0.4658
deviation temp :
What is the probability of temperature
having fallen below 2 deg C?
Code:pnorm(2,mean=mean(df$Temperature),sd(d
f$Temperature))
Code 2: create function to shade
shade <- function(x, bound) {
Height <- dnorm(x, mean =
mean(df$Temperature),
sd = sd(df$Temperature))
Height[x > bound] <- NA
return(Height)
}
Code 3: ggplot(data =
normal,aes(x=Temperature,y=Height))+geom_line
()+stat_function(fun = shade,args = 2.0,geom =
"area", alpha =
.5,fill="red")+ggtitle(paste0("Probability: ",
round(pnorm(2,mean=mean(df$Temperature),sd(
df$Temperature),lower.tail = T),4)*100,"%"))
What is the probability of temperature
having gone above 4 deg C?
Code :ggplot(data =
normal,aes(x=Temperature,y=Height))+geo
m_line()+stat_function(fun = shade,args =
4.0,geom = "area", alpha =
.5,fill="red")+ggtitle(paste0("Probability: ",
round(pnorm(4.0,mean=mean(df$Temperat
ure),sd(df$Temperature),lower.tail =
F),4)*100,"%"))
Code :
shade <- function(x, bound) {
Height <- dnorm(x, mean =
mean(df$Temperature), sd = sd(df$Temperature))
Height[x < bound] <- NA
return(Height)
}
What will be the penalty for the AMC
Company?
If the probability of temperature going outside the 2 - 4 C during the one-year contract was above 2.5%
and less than 5% then the penalty would be 10% of AMC (annual maintenance case). In case it exceeded
5% then the penalty would be 25% of the AMC fee.
Probability of temperature going outside the 2 - 4 C = Probability of temp having gone above 4 and
below 2 => 1.61% + 1.57% = 3.18%
Thus penalty will be 10% of AMC.
Which Hypothesis test shall be performed to
check if corrective action is needed at the
cold storage plant?
Conclusion : Since we reject that the mean is less than or equal to 3.9 it can
be said that there is some issue from the dairy’s end. The manager needs to
extra vigilant through out the day control temperature of the storage. Since it
is summer season a natural increase in temperature is likely to increase.
There is enough evidence to conclude that mean is greater than 3.9.