Sei sulla pagina 1di 10

Project Report

Cold Storage Temperature Analysis

pg. 1
Table of contents
1 Project objective------------------------------------------------------------------------------------------3
2 Assumptions-----------------------------------------------------------------------------------------------3
3 Exploratory Data Analysis------------------------------------------------------------------------------3
3.1 Environment setup and Library Installation---------------------------------------------------3
3.1.1 Library Installation-----------------------------------------------------------------------------3
3.1.2 Setting Up Working Directory--------------------------------------------------------------3
3.1.3 Import Dataset & Read Dataset------------------------------------------------------------3
3.2 Variable Identification------------------------------------------------------------------------------4
3.3 Univariate Analysis---------------------------------------------------------------------------------4
3.4 Bivariate Analysis-----------------------------------------------------------------------------------5
4 Problem 1 Analysis---------------------------------------------------------------------------------------6
4.1 Task 1-Finding Mean Temperature for all seasons-----------------------------------------6
4.2 Task 2-Finding Mean Temperature for full year---------------------------------------------6
4.3 Task 3-Finding Standard deviation for full year----------------------------------------------6
4.4 Task 4-Finding Probability of Temperature falling below 2 degree C------------------7
4.5- Task 5-Finding Probability of Temperature going above 4 degree C-----------------7
4.6- Task 6- Finding the percentage of penalty on company---------------------------------7
5 Problem 2 Analysis--------------------------------------------------------------------------------------8
5.1-Z-Test --------------------------------------------------------------------------------------------------8
5.1.1- Stating Null & Alternative Hypothesis----------------------------------------------------8
5.1.2- Z-Value Calculation--------------------------------------------------------------------------8
5.1.3 – Level of Significance-----------------------------------------------------------------------8
5.1.4- P-Value Calculation--------------------------------------------------------------------------8
5.1.5- Conclusion based on Z-test----------------------------------------------------------------8
5.2-t-Test---------------------------------------------------------------------------------------------------9
5.2.1- Stating Null & Alternative Hypothesis----------------------------------------------------9
5.2.2- t-Value Calculation---------------------------------------------------------------------------9
5.2.3- Conclusion based on T-test----------------------------------------------------------------9
6 Conclusion------------------------------------------------------------------------------------------------10

pg. 2
1) Project Objective: -To analysis the data and determine the following things:-
 Whether the contracted company is running cold storage properly and
maintaining temperature between 2-4 degree Celsius throughout the year or not.
 To check if any kind of corrective measure require in cold storage operation.
 To check if any kind penalty is applicable on contracted company.
 To find out is there any problem from the procurement side of cold storage.

2) Assumptions: -
 Here we assume that cold storage temperature data is normally distributed.
3)Exploratory Data Analysis

3.1) Environment setup and library installation.

3.1.1) Library Installation

library(readr)
library(dplyr)

3.1.2) Setting Up Working Directory

setwd("C:/Users/rajat/Desktop/GL/Project/Project 1")

3.1.3) Import Dataset & Read Dataset

mydata=read.csv("Cold_Storage_Temp_Data.csv",header = TRUE)
str(mydata)
'data.frame': 365 obs. of 4 variables:
$ Season : Factor w/ 3 levels "Rainy","Summer",..: 3 3 3 3 3 3 3 3 3 3 ...
$ Month : Factor w/ 12 levels "Apr","Aug","Dec",..: 5 5 5 5 5 5 5 5 5 5 ...
$ Date : int 1 2 3 4 5 6 7 8 9 10 ...

pg. 3
$ Temperature: num 2.4 2.3 2.4 2.8 2.5 2.4 2.8 2.3 2.4 2.8 ...

temp=read.csv("Cold_Storage_Mar2018 .csv",header = TRUE)


Str(temp)
'data.frame': 35 obs. of 4 variables:
$ Season : Factor w/ 1 level "Summer": 1 1 1 1 1 1 1 1 1 1 ...
$ Month : Factor w/ 2 levels "Feb","Mar": 1 1 1 1 1 1 1 1 1 1 ...
$ Date : int 11 12 13 14 15 16 17 18 19 20 ...
$ Temperature: num 4 3.9 3.9 4 3.8 4 4.1 4 3.8 3.9 ...

3.2) Variable identification


 Dplyr:- I used dplyr package for calculating mean temperature of different season
by using group by and summaries.
 Pnorm:- I m used pnorm for calculating probability using normal distribution.
 t.test- For calculating t value and p- value
 mean=For calculating mean of temperature
 Sd= For calculating Standard Deviation of temperature.
3.3) Univariate Analysis
 Histogram plot for Temperature distribution

hist(mydata$Temperature,xlab = "Cold_Storage_Temperature",col = "blue",main="Temperature


Distribution")

pg. 4
 To check whether our data set have any outlier

boxplot(mydata$Temperature,horizontal = TRUE,xlab="Temperature")

From Above Box Plot it is clear that our temperature dataset have outliers.
3.4 Bivariate Analysis
 Different season vs Mean_temperature plot.

ggplot(Avg,aes(x=Season,y=Mean_Temp))+geom_col(col="steelblue",size=20,width = 0.1)

pg. 5
4) Problem 1-Solution
4.1) Task 1: - Finding out the cold storage Mean Temp for summer, winter & Rainy
Season

Avg=mydata %>% group_by(Season) %>% summarise(Mean_Temp=mean(Temperature))


Avg

## # A tibble: 3 x 2
## Season Mean_Temp
## <fct> <dbl>
## 1 Rainy 3.04
## 2 Summer 3.15
## 3 Winter 2.70

From Above it is clear that: -


 Mean_Temp throughout Rainy season is=3.04
 Mean_Temp throughout Summer season is=3.15
 Mean_Temp throughout winter season is=2.70

4.2)Task 2:- Mean temp of cold storage for full year

Yearly_mean_temp=mean(mydata$Temperature)
Yearly_mean_temp

## [1] 2.96274

4.3) Task 3:- Finding out Standard Deviation of Temp

Temp_standard_deviation=sd(mydata$Temperature)
Temp_standard_deviation

## [1] 0.508589

pg. 6
4.4) Task 4:- Finding ,what is the probability of temperature having fallen below 2 deg C
using Normal Distribution
Given:-
 Mean=2.96
 SD=0.508
Probability(temp<2)

pnorm(q=2,mean=2.96,sd=0.508589,lower.tail = TRUE)

## [1] 0.0295415

4.5) Task 5:- Finding ,what is the probability of temperature going above 4 deg C using
Normal Distribution
Given:-
 Mean=2.96
 SD=0.508
Probability(temp>4)

pnorm(q=4,mean=2.96,sd=0.508589,lower.tail = FALSE)

## [1] 0.02043368

4.6) Task 6:-Finding what is penalty for the AMC Company.


For finding penalty value we will find out what is the probability of temp going
below 2 and above 4

i.e. P(2 > temp > 4)= P(temp<2) + P(temp>4) =0.04997518

Here probability of temperature going out of range of 2 degree C to 4 degree C


is 4.9 %. So according to contact if probability is above 2.5% and less than 5% then
Penalty is 10% of AMC.

pg. 7
5) Problem 2 Analysis

5.1) Task 1: - Z-Test


Given: -
 Sigma=0.5085
 X-bar=3.97,
 Sample size(n)=35
5.1.1) Step 1: Stating our hypothesis
Ho= Temp (Mu) >3.9
Ha= Temp (Mu) ≤3.9
5.1.2) Step 2: Z-value calculation

SE=0.5085/sqrt(35)
Xbar=3.97
Mu=3.9
z=(Xbar-Mu)/SE
z

## [1] 0.8144063
therefor, Z-VALUE=0.814406

5.1.3) Step 3: Level of Significance, Alpha=0.1

5.1.4) Step 4: Calculating P Value

P_Value=pnorm(-abs(z))
P_Value

## [1] 0.2077061
therefor P-value=0.2077061

5.1.5) Step 5- Conclusion


Hence, From Z-test it is clear that P-value=0.2077 is greater than Alpha=0.1 , so
we can’t reject null hypothesis.

pg. 8
5.2) Task 2: t-test
Given:
 Mu=3.9
 Level of Confidence=0.90
5.2.1) Step 1: Stating our hypothesis
Ho= Temp (Mu) >3.9
Ha= Temp (Mu) ≤3.9
5.2.2) Step 2: t-value calculation

t.test(Temperature,mu=3.9, alternative = "less",conf.level = 0.90)

##
## One Sample t-test
##
## data: Temperature
## t = 2.7524, df = 34, p-value = 0.9953
## alternative hypothesis: true mean is less than 3.9
## 90 percent confidence interval:
## -Inf 4.00956
## sample estimates:
## mean of x
## 3.974286

5.2.3) t-test Conclusion:-

From test it is clear that p-value=0.999 is greater than


alpha=0.1. so we can’t reject null hypothesis

pg. 9
6) Project Conclusion:-

After running both t-test and z-test it is very clear that we can’t reject our null
hypothesis that means cold storage temperature goes above 3.9 degree Celsius
which proves that contracted company is not able to maintain the cold storage
temperature between the temperature range of 2 – 4 degree Celsius which is the
standard temperature range required to ensure that there is no change of texture,
body appearance, separation of fats in milk products.

Hence corrective measures are required by cold storage owner against the contracted
company to avoid any such failures in future because such failures can lead in loss of
customer on large scale.

pg. 10

Potrebbero piacerti anche