1. Concepts & Definitions
1.1. Defining statistical test of hypothesis
1.2. Numerical example of test of hypothesis for mean
1.3. Code for test of hypothesis for mean
1.4. Code for right tailed test of hypothesis for mean
1.5. Code for left tailed test of hypothesis for mean
1.6. Code for small sample hypothesis for mean
1.7. P-Value and test of hypothesis
1.8. Statistical power and power analysis
1.9. Shapiro Wilk for normality test
2. Problem & Solution
2.1. Shapiro Wilk to verify CLT Simulator
The average service time of a company in 2018 was 12.44 minutes. Management wants to know whether the arithmetic mean current is different from 12.44 minutes. A sample with 150 values had an arithmetic mean of 13.71 minutes and a standard deviation of 2.65 minutes. Using α = 5%, can you conclude whether the time is currently different?
Before trying to solve this problem is interesting to have a close look at the steps defined by the flowchart to create a test hypothesis.
If you trace back the history of the situation, the null hypothesis (Ho) is always the accepted fact from previous experimentation and observations. Or, the null hypothesis is a prediction of no relationship between the variables you are interested in. The alternate hypothesis (Ha) is usually your initial hypothesis that predicts a relationship between variables. In this example:
Null hypothesis (Ho): The mean had been not affected, i.e., μ = 12.44.
Alternate hypothesis (Ha): Then the mean had been affected, i.e., μ ≠ 12.44.
From the table described in the step to choose a statistical test, the sign of the hypotheses Ho and Ha point that a two-tailed test should be carried.
Since the sample is larger than 30, then a normal distribution could be employed.
Remember from Track 07 - Section 1.5:
A consequence of using a confidence interval of 95% is that there are 5% of values are outside the interval which means:
2.5% of the values are lower than the lower bound of the confidence interval.
2.5% of the values are greater than the upper bound of the confidence interval.
The sum of both percentages is called the significance level (α = alpha). Common significance levels include α =0.05 and α = 0.01. The relationship between the confidence level and the significance level is expressed as:
Confidence level = 1 - Significance level (α).
In other words, the confidence level equals one minus the significance level. For example, if our significance level is 0.05, this means that there is a 5% probability of rejecting the null hypothesis when it is true. The corresponding confidence level would be 1 - 0.05 = 0.95 or 95%.
This brings a new question on how to determine the critical value z α/2 that will be employed as an upper and lower bound to the confidence interval. For this purpose, the inverse of the value of the standard normal distribution is useful since it answers how should be the value of critical z α/2 to cover a certain percentage of the population. The next figure illustrates this aspect.
The next table helps to understand the relation between confidence level, alpha (α), and the critical value z α/2.
Then z α/2 = 1.96 and -z α/2 = -1.96.
To compute a statistical test is necessary to convert the observed value in the mean of the sample (x̄) to the scale of a standard normal distribution (Zobs). These could be done using the following equation:
zobs = (x̄ - μ)/(s/(n^0.5))
This equation will result in the following numbers:
zobs = (13.71 - 12.44)/(2.65/(150^0.5)) = (13.71-12.44)/0.2164 = 5.87
Since Zobs = 5.87 is higher than upper critical value z α/2 = 1.96, then we can reject the Null hypothesis.
Null hypothesis (Ho): The mean had been not affected, i.e., μ = 12.44.
Alternate hypothesis (Ha): Then the mean had been affected, i.e., μ ≠ 12.44.
From the table described in the step to choose a statistical test, the sign of the hypotheses Ho and Ha point that a two-tailed test should be carried.
Since the sample is larger than 30, then a normal distribution could be employed.
The next table helps to understand the relation between confidence level, alpha (α), and the critical value z α/2.
To compute a statistical test is necessary to convert the observed value in the mean of the sample (x̄) to the scale of a standard normal distribution (Zobs). These could be done using the following equation:
zobs = (x̄ - μ)/(s/(n^0.5))
This equation will result in the following numbers:
zobs = (13.71 - 12.44)/(2.65/(150^0.5)) = (13.71-12.44)/0.2164 = 5.87
Since Zobs = 5.87 is higher than upper critical value z α/2 = 1.96, then we can reject the Null hypothesis.