hypothesis testing using p-value:



case study:

The Assembly Time(AT) is the total time product one spends in the production line.  The industrial engineer claims that the average total AT for product one is 202.5 minutes. The operations manager suspects that this is an overstatement and that the actual average is less than 202.5. He selects a random sample of 85 products and obtains a mean AT of 199.2 with standard deviation 19.63. Determine, at the 5% level of significance, whether it is sufficient evidence in the sample to reject the engineer's claim.

solution:
# step one:establishing the test heypothesis:
#H0 average population = 202.5
#Ha average population < 202.5 
# from Ha we can conclude it is a left tailed test

sample_avg = 199.2
sample_size = 85
sample_std = 19.63
alfa = 0.05 # level of significance
population_avg = 202.5 # population average or the claimed average


#step two & three: calculating test statistic(z = sample avg. - population avg./ sample std deviation/ sqrt(sample size))

z_value = (sample_avg - population_avg)/
          (sample_std/ sqrt(sample_size))

#step 4: finidng p-value 
p_value <- tigerstats::pnormGC(z_value, 
                    region = "below",  # left tailed test
                    mean = 0, 
                    sd = 1, 
                    graph = TRUE)

# alternative solution: 
p_value = pnorm(0.06058301)

# step five : decsion making 
if (p_value > alfa){
  print("don't reject H0")
}else{
  print("reject H0 in favor of Ha")
}

conclusion:

Since p = 0.0606 > 0.05 = α , the decision is not to reject H0. In the context of the problem our conclusion is:

The data do not provide sufficient evidence, at the 5% level of significance, to conclude that the average AT is less than 202.5.


Comments

Popular posts from this blog

Simulation Project: Production Line Wasted Outputs

simulating production volume

supplier evaluation using population proportion tests hypothesis