Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
library(readr)
library(dplyr)
setwd("C:/Users/rajat/Desktop/GL/Project/Project 1")
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 ...
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
## # A tibble: 3 x 2
## Season Mean_Temp
## <fct> <dbl>
## 1 Rainy 3.04
## 2 Summer 3.15
## 3 Winter 2.70
Yearly_mean_temp=mean(mydata$Temperature)
Yearly_mean_temp
## [1] 2.96274
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
pg. 7
5) Problem 2 Analysis
SE=0.5085/sqrt(35)
Xbar=3.97
Mu=3.9
z=(Xbar-Mu)/SE
z
## [1] 0.8144063
therefor, Z-VALUE=0.814406
P_Value=pnorm(-abs(z))
P_Value
## [1] 0.2077061
therefor P-value=0.2077061
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
##
## 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
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