Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Hypothesis Testing

Hypothesis Testing

Inferential Statistics

Sometimes, you may require a very large amount of data for your analysis which may need too much time and resources to acquire. In such situations, you are forced to work with a smaller sample of the data, instead of having the entire data to work with.

Situations like these arise all the time at big companies like Amazon. For example, say the Amazon QC department wants to know what proportion of the products in its warehouses are defective. Instead of going through all of its products (which would be a lot!), the Amazon QC team can just check a small sample of 1,000 products and then find, for this sample, the defect rate (i.e. the proportion of defective products). Then, based on this sample’s defect rate, the team can “infer” what the defect rate is for all the products in the warehouses. This process of “inferring” insights from sample data is called “Inferential Statistics”.


Hypothesis Testing

Hypothesis testing is used to confirm your conclusions about the population parameter. Through this we can conclude if there is enough evidence to confirm the hypothesis about the population.

Steps

📖Source

A common alternative formulation of this process goes as follows:

The former process was advantageous in the past when only tables of test statistics at common probability thresholds were available. It allowed a decision to be made without the calculation of a probability. It was adequate for classwork and for operational use, but it was deficient for reporting results. The latter process relied on extensive tables or on computational support not always available. The explicit calculation of a probability is useful for reporting. The calculations are now trivially performed with appropriate software.

The difference in the two processes applied to the Radioactive suitcase example (below):

The former report is adequate, the latter gives a more detailed explanation of the data and the reason why the suitcase is being checked.

Example

A manufacturer claims that the average life of its products is 36 months. An auditor selects a sample of 49 units of the product and calculates the average life to be 34.5 months. The population standard deviation is 4 months. Test the manufacturer’s claim at 3%3\% significance level.

So as per the above problem:

α=3%\alpha = 3\% or 0.03 σ=4\sigma = 4 N=49N = 49

First we will take a look into the Critical-value method:

In this case we will have critical region at both sides with total area of 0.03.

So the area to the right = 0.015, which means that area till UCV (cumulative probability till that point) =10.015=0.985= 1-0.015=0.985

zz-score of cumulative probability of UCV (ZcZ_c in this case) =z= z-score of 0.985=2.170.985 = 2.17

Calculating the critical values UCV/LCV =μ±ZcσN= \mu \pm Z_c * \frac{\sigma}{\sqrt{N}}

UCV/LCV =36±2.17449=37.24 and 34.76= 36 \pm 2.17 * \frac{4}{\sqrt{49}} = 37.24 \text{ and } 34.76

Now as the sample mean 34.5 is not between UCV and LCV hence we reject the null hypothesis.

Now let’s solve it using the pp-value method:

Calculate the zz-score of 34.5=xˉμσN=2.6234.5 = \frac{\bar{x} -\mu}{\frac{\sigma}{\sqrt{N}}} = -2.62

Calculate the p-value from table =0.0044= 0.0044, which is cumulative area till sample point$

As this it is in the left hand side hence there is no need to substract from 1.

Now this will be a 2-tailed test as we are checking for inequality, we need to multiply by 2=0.00882 = 0.0088, remember 1-tailed test provides more power to detect an effect because the entire weight is allocated to one direction only.

As pp-value is <α< \alpha so we reject null-hypothesis.

Errors in Hypothesis Testing

Types of Errors in Hypothesis testing (📖Source)

Figure 2:Types of Errors in Hypothesis testing (📖Source)


Questions