Professional Documents
Culture Documents
Solution to Problem 1
o Importing the dataset for coldstorage
o 1. Mean cold storage temperature for Summer, Winter and Rainy Season
o 2. Overall mean for the full year
o 3. Standard Deviation for the full year
o 4. Probability of temperature going less than 2 deg C
o 5. Probability of temperature going above 4 deg c
o 6. Penalty for AMC Company
Solution to Problem 2
o Importing the dataset
o Hypothesis of Z test
o Rationale
o Calculation of z test
o Hypothesis for t - test
o Inference
Code
Solution to Problem 1
Importing the dataset for coldstorage
Hide
storcold <- read.csv("Cold_Storage_Temp_Data.csv")
summary(storcold)
## Season Month Date Temperature
## Rainy :122 Aug : 31 Min. : 1.00 Min. :1.700
## Summer:120 Dec : 31 1st Qu.: 8.00 1st Qu.:2.500
## Winter:123 Jan : 31 Median :16.00 Median :2.900
## Jul : 31 Mean :15.72 Mean :2.963
## Mar : 31 3rd Qu.:23.00 3rd Qu.:3.300
## May : 31 Max. :31.00 Max. :5.000
## (Other):179
Solution to Problem 2
Importing the dataset
Hide
Mar_ColdST <- read_csv("Cold_Storage_Mar2018.csv")
## Parsed with column specification:
## cols(
## Season = col_character(),
## Month = col_character(),
## Date = col_double(),
## Temperature = col_double()
## )
Hide
summary(Mar_ColdST)
## Season Month Date Temperature
## Length:35 Length:35 Min. : 1.0 Min. :3.800
## Class :character Class :character 1st Qu.: 9.5 1st Qu.:3.900
## Mode :character Mode :character Median :14.0 Median :3.900
## Mean :14.4 Mean :3.974
## 3rd Qu.:19.5 3rd Qu.:4.100
## Max. :28.0 Max. :4.600
Code
Hypothesis of Z test
Hypothesis will be defined for both Z and T test as (both will carry the same hypothesis)
Ho mu <= 3.9 Ha mu > 3.9
Null hypothesis Ho = Average temperature will be less than or equivalent to upper limit of 3.9 degC
Alternate hypothesis Ha = Average temp has risen more than 3.9 degC
Rationale
As customer I have different opinion than Supervisor of Plant . I know that food item was smelling sour
hence temperature must have breached some threshold limit of referigeration plant
As Supervisor would want to maintain status quo that temperature has not crossed 3.9 degC as he had
ordered. So from Customer standpoint I want to prove against the status quo of 3.9 degC
This will be a right tailed test as mu > 3.9 is what We are trying to prove
Calculation of z test
Hide
sample_mean = mean(Mar_ColdST$Temperature)
print (sample_mean)
## [1] 3.974286
Hide
sample_sd = sd(Mar_ColdST$Temperature)
print(sample_sd)
## [1] 0.159674
Hide
std_error = sample_sd / (sqrt(35))
print(std_error)
## [1] 0.02698984
Hide
mu = 3.9
Hide
z_critical = 1.28
Since z-statistic value = 2.75 is greater than z-critical value of 1.28 at significance level alpha =0.1 Hence
we Reject the null hypotheis
We accept the Alternate hypothesis that temperature has indeed risen more than 3.9 degC
print(t_test)
##
## One Sample t-test
##
## data: Mar_ColdST$Temperature
## t = 2.7524, df = 34, p-value = 0.004711
## alternative hypothesis: true mean is greater than 3.9
## 90 percent confidence interval:
## 3.939011 Inf
## sample estimates:
## mean of x
## 3.974286
Inference
Both the tests ( z as well as t ) proved that Temperature had been well over 3.9 degC against the claims of
Supervisor who had been vigilant about not breaching the 3.9 degC
The sample size of 35 days is optimum enough to conduct both z and t tests And at this optimum size we
find that t-statistic value and z-statistic value are almost similar
t-statistic = z-statistic = 2.75 ( another striking similarity to reject the Null hypotheis )