Statistics for Beginners in Excel – One Sample Hypothesis Testing of the Variance

(Basic Statistics for Citizen Data Scientist)

One Sample Hypothesis Testing of the Variance

Based on Theorem 2 of Chi-square Distribution and its corollaries, we can use the chi-square distribution to test the variance of a distribution.

Example 1: A company produces metal pipes of a standard length. Twenty years ago it tested its production quality and found that the lengths of the pipes produced were normally distributed with a standard deviation of 1.1 cm. They want to test whether they are still meeting this level of quality by testing a random sample of 30 pipes, and finding the 95% confidence interval around σ2.

By Theorem 2 of of Chi-square Distribution

image799

Note that since the chi-square distribution is not symmetric, the confidence interval is not symmetric around σ2, and so the approach used in Confidence Intervals for Sampling Distributions and Confidence Interval for t-test needs to be modified somewhat, in that we need to calculate the lower and upper values of the confidence interval based on different critical values of the distribution:

Upper limit = 0.042*CHIINV(.025, 29) = 0.042 ∙ 45.72 = 1.91

Lower limit = 0.042*CHIINV(.975, 29) = 0.042 ∙ 16.05 = 0.67

And so the confidence interval is (0.67, 1.91). We see that the variance of  (1.1)2 = 1.21 is  in this range, but the sample is too small to get much precision.

Example 2: A company produces metal pipes of a standard length, and claims that the standard deviation of the length is at most 1.2 cm. One of its clients decides to test this claim by taking a sample of 25 pipes and checking their lengths. They found that the standard deviation of the sample is 1.5 cm. Does this undermine the company’s claim?

We perform a one tail test based on the following hypotheses:

H0: the standard deviation of the pipe length is ≤ 1.2 cm
H1: the standard deviation of the pipe length is > 1.2 cm

If we assume that the population has a normal distribution then by Corollary 3 of Chi-square Distribution, we know that

image803

Since
image802

it follows that

p-value = CHIDIST(x, df) = CHIDIST(37.5, 24) = 0.039 < .05 = α

and so the null hypothesis is rejected, leading the client to conclude with 95% confidence that the company is no longer meeting their claimed quality standard.

Alternatively, x-crit = CHIINV(α, df) = CHIINV(.05, 24) = 36.42 < 37.5 = x and so once again the null hypothesis is rejected.

Observation: In Example 2 we used a one-tail test. For a two-tail test, proceed as follows using the null hypothesis

H0: the standard deviation of the pipe length is = 1.2 cm

We reject the null hypothesis if either CHIDIST(x, df) = .039 < .025 = α/2 or CHIDIST(x, df) = .039 > 1 – α/2 = .975. As result, in this case, we can’t reject the null hypothesis. Alternatively, we reject the null hypothesis if either 37.5 = x > CHIINV(α/2, df) = CHIINV(.025, 24) = 39.4 or 37.5 = x < CHIINV(1–α/2, df) = 12.4, and so once again we cannot reject the null hypothesis in the two-tail test.

 

How to generate BAR plot with Variance in Python

 

Statistics for Beginners in Excel – One Sample Hypothesis Testing of the Variance

Personal Career & Learning Guide for Data Analyst, Data Engineer and Data Scientist

Applied Machine Learning & Data Science Projects and Coding Recipes for Beginners

A list of FREE programming examples together with eTutorials & eBooks @ SETScholars

95% Discount on “Projects & Recipes, tutorials, ebooks”

Projects and Coding Recipes, eTutorials and eBooks: The best All-in-One resources for Data Analyst, Data Scientist, Machine Learning Engineer and Software Developer

Topics included: Classification, Clustering, Regression, Forecasting, Algorithms, Data Structures, Data Analytics & Data Science, Deep Learning, Machine Learning, Programming Languages and Software Tools & Packages.
(Discount is valid for limited time only)

Disclaimer: The information and code presented within this recipe/tutorial is only for educational and coaching purposes for beginners and developers. Anyone can practice and apply the recipe/tutorial presented here, but the reader is taking full responsibility for his/her actions. The author (content curator) of this recipe (code / program) has made every effort to ensure the accuracy of the information was correct at time of publication. The author (content curator) does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause. The information presented here could also be found in public knowledge domains.

Learn by Coding: v-Tutorials on Applied Machine Learning and Data Science for Beginners

Please do not waste your valuable time by watching videos, rather use end-to-end (Python and R) recipes from Professional Data Scientists to practice coding, and land the most demandable jobs in the fields of Predictive analytics & AI (Machine Learning and Data Science).

The objective is to guide the developers & analysts to “Learn how to Code” for Applied AI using end-to-end coding solutions, and unlock the world of opportunities!