hypothesis testing using p-value:
case study:
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
Post a Comment