• Descriptive
    • Moments
    • Concentration
    • Central Tendency
    • Variability
    • Stem-and-Leaf Plot
    • Histogram & Frequency Table
    • Data Quality Forensics
    • Conditional EDA
    • Quantiles
    • Kernel Density Estimation
    • Normal QQ Plot
    • Bootstrap Plot

    • Multivariate Descriptive Statistics
  • Distributions
    • Binomial Probabilities
    • Geometric Probabilities
    • Negative Binomial Probabilities
    • Hypergeometric Probabilities
    • Multinomial Probabilities
    • Poisson Probabilities

    • Exponential
    • Gamma
    • Erlang
    • Weibull
    • Rayleigh
    • Lognormal
    • Pareto
    • Inverse Gamma

    • Beta
    • Power
    • Beta Prime (Inv. Beta)
    • Triangular

    • Normal (area)
    • Logistic
    • Laplace
    • Cauchy (standard)
    • Cauchy (location-scale)
    • Gumbel

    • Normal RNG
    • ML Fitting
    • Tukey Lambda PPCC
    • Box-Cox Normality Plot
    • Sample Correlation r

    • Empirical Tests
  • Hypotheses
    • Theoretical Aspects of Hypothesis Testing
    • Bayesian Inference
    • Minimum Sample Size

    • Empirical Tests
    • Multivariate (pair-wise) Testing
  • Models
    • Manual Model Building
  • Time Series
    • Time Series Plot
    • Decomposition
    • Exponential Smoothing

    • Blocked Bootstrap Plot
    • Mean Plot
    • (P)ACF
    • VRM
    • Standard Deviation-Mean Plot
    • Spectral Analysis
    • ARIMA

    • Cross Correlation Function
    • Granger Causality
  1. Hypothesis Testing
  2. 97  Statistical Test of the Variance
  • Preface
  • Getting Started
    • 1  Introduction
    • 2  Why Do We Need Innovative Technology?
    • 3  Basic Definitions
    • 4  The Big Picture: Why We Analyze Data
  • Introduction to Probability
    • 5  Definitions of Probability
    • 6  Jeffreys’ axiom system
    • 7  Bayes’ Theorem
    • 8  Sensitivity and Specificity
    • 9  Naive Bayes Classifier
    • 10  Law of Large Numbers

    • 11  Problems
  • Probability Distributions
    • 12  Bernoulli Distribution
    • 13  Binomial Distribution
    • 14  Geometric Distribution
    • 15  Negative Binomial Distribution
    • 16  Hypergeometric Distribution
    • 17  Multinomial Distribution
    • 18  Poisson Distribution

    • 19  Uniform Distribution (Rectangular Distribution)
    • 20  Normal Distribution (Gaussian Distribution)
    • 21  Gaussian Naive Bayes Classifier
    • 22  Chi Distribution
    • 23  Chi-squared Distribution (1 parameter)
    • 24  Chi-squared Distribution (2 parameters)
    • 25  Student t-Distribution
    • 26  Fisher F-Distribution
    • 27  Exponential Distribution
    • 28  Lognormal Distribution
    • 29  Gamma Distribution
    • 30  Beta Distribution
    • 31  Weibull Distribution
    • 32  Pareto Distribution
    • 33  Inverse Gamma Distribution
    • 34  Rayleigh Distribution
    • 35  Erlang Distribution
    • 36  Logistic Distribution
    • 37  Laplace Distribution
    • 38  Gumbel Distribution
    • 39  Cauchy Distribution
    • 40  Triangular Distribution
    • 41  Power Distribution
    • 42  Beta Prime Distribution
    • 43  Sample Correlation Distribution

    • 44  Problems
  • Descriptive Statistics & Exploratory Data Analysis
    • 45  Types of Data
    • 46  Datasheets

    • 47  Frequency Plot (Bar Plot)
    • 48  Frequency Table
    • 49  Contingency Table
    • 50  Binomial Classification Metrics
    • 51  Confusion Matrix
    • 52  ROC Analysis

    • 53  Stem-and-Leaf Plot
    • 54  Histogram
    • 55  Data Quality Forensics
    • 56  Quantiles
    • 57  Central Tendency
    • 58  Variability
    • 59  Skewness & Kurtosis
    • 60  Concentration
    • 61  Notched Boxplot
    • 62  Scatterplot
    • 63  Pearson Correlation
    • 64  Rank Correlation
    • 65  Partial Pearson Correlation
    • 66  Simple Linear Regression
    • 67  Moments
    • 68  Quantile-Quantile Plot (QQ Plot)
    • 69  Normal Probability Plot
    • 70  Probability Plot Correlation Coefficient Plot (PPCC Plot)
    • 71  Box-Cox Normality Plot
    • 72  Kernel Density Estimation
    • 73  Bivariate Kernel Density Plot
    • 74  Conditional EDA: Panel Diagnostics
    • 75  Bootstrap Plot (Central Tendency)
    • 76  Survey Scores Rank Order Comparison
    • 77  Cronbach Alpha

    • 78  Equi-distant Time Series
    • 79  Time Series Plot (Run Sequence Plot)
    • 80  Mean Plot
    • 81  Blocked Bootstrap Plot (Central Tendency)
    • 82  Standard Deviation-Mean Plot
    • 83  Variance Reduction Matrix
    • 84  (Partial) Autocorrelation Function
    • 85  Periodogram & Cumulative Periodogram

    • 86  Problems
  • Hypothesis Testing
    • 87  Normal Distributions revisited
    • 88  The Population
    • 89  The Sample
    • 90  The One-Sided Hypothesis Test
    • 91  The Two-Sided Hypothesis Test
    • 92  When to use a one-sided or two-sided test?
    • 93  What if \(\sigma\) is unknown?
    • 94  The Central Limit Theorem (revisited)
    • 95  Statistical Test of the Population Mean with known Variance
    • 96  Statistical Test of the Population Mean with unknown Variance
    • 97  Statistical Test of the Variance
    • 98  Statistical Test of the Population Proportion
    • 99  Statistical Test of the Standard Deviation \(\sigma\)
    • 100  Statistical Test of the difference between Means -- Independent/Unpaired Samples
    • 101  Statistical Test of the difference between Means -- Dependent/Paired Samples
    • 102  Statistical Test of the difference between Variances -- Independent/Unpaired Samples

    • 103  Hypothesis Testing for Research Purposes
    • 104  Decision Thresholds, Alpha, and Confidence Levels
    • 105  Bayesian Inference for Decision-Making
    • 106  One Sample t-Test
    • 107  Skewness & Kurtosis Tests
    • 108  Paired Two Sample t-Test
    • 109  Wilcoxon Signed-Rank Test
    • 110  Unpaired Two Sample t-Test
    • 111  Unpaired Two Sample Welch Test
    • 112  Two One-Sided Tests (TOST) for Equivalence
    • 113  Mann-Whitney U test (Wilcoxon Rank-Sum Test)
    • 114  Bayesian Two Sample Test
    • 115  Median Test based on Notched Boxplots
    • 116  Chi-Squared Tests for Count Data
    • 117  Kolmogorov-Smirnov Test
    • 118  One Way Analysis of Variance (1-way ANOVA)
    • 119  Kruskal-Wallis Test
    • 120  Two Way Analysis of Variance (2-way ANOVA)
    • 121  Repeated Measures ANOVA
    • 122  Friedman Test
    • 123  Testing Correlations
    • 124  A Note on Causality

    • 125  Problems
  • Regression Models
    • 126  Simple Linear Regression Model (SLRM)
    • 127  Multiple Linear Regression Model (MLRM)
    • 128  Logistic Regression
    • 129  Generalized Linear Models
    • 130  Multinomial and Ordinal Logistic Regression
    • 131  Cox Proportional Hazards Regression
    • 132  Conditional Inference Trees
    • 133  Leaf Diagnostics for Conditional Inference Trees
    • 134  Hypothesis Testing with Linear Regression Models (from a Practical Point of View)

    • 135  Problems
  • Introduction to Time Series Analysis
    • 136  Case: the Market of Health and Personal Care Products
    • 137  Decomposition of Time Series
    • 138  Ad hoc Forecasting of Time Series
  • Box-Jenkins Analysis
    • 139  Introduction to Box-Jenkins Analysis
    • 140  Theoretical Concepts
    • 141  Stationarity
    • 142  Identifying ARMA parameters
    • 143  Estimating ARMA Parameters and Residual Diagnostics
    • 144  Forecasting with ARIMA models
    • 145  Intervention Analysis
    • 146  Cross-Correlation Function
    • 147  Transfer Function Noise Models
    • 148  General-to-Specific Modeling
  • References
  • Appendices
    • Appendices
    • A  Method Selection Guide
    • B  Presentations and Teaching Materials
    • C  R Language Concepts for Statistical Computing
    • D  Matrix Algebra
    • E  Standard Normal Table (Gaussian Table)
    • F  Critical values of Student’s \(t\) distribution with \(\nu\) degrees of freedom
    • G  Upper-tail critical values of the \(\chi^2\)-distribution with \(\nu\) degrees of freedom
    • H  Lower-tail critical values of the \(\chi^2\)-distribution with \(\nu\) degrees of freedom

Table of contents

  • 97.1 Theory
    • 97.1.1 Statistical Hypothesis: Testing the Variance - Population
    • 97.1.2 Statistical Hypothesis: Testing the Variance - Sample
    • 97.1.3 Statistical Hypothesis: Testing the Variance - Critical Region
    • 97.1.4 The Chi-squared distribution
    • 97.1.5 Approximation of the Chi-squared distribution
    • 97.1.6 Distribution of Sample Variance
    • 97.1.7 Summary
  • 97.2 Examples
    • 97.2.1 Statistical Hypothesis: Testing Variance -- Example 1: Critical Value (Region)
    • 97.2.2 Statistical Hypothesis: Testing Variance -- Example 2: p-value (probability)
    • 97.2.3 Statistical Hypothesis: Testing Variance -- Example 3: Acceptance Regions for Sample Variance (under H\(_0\))
    • 97.2.4 Statistical Hypothesis: Testing Variance -- Example 4: Confidence Intervals for Population Variance
DRAFT This draft is under development — DO NOT CITE OR SHARE.
  1. Hypothesis Testing
  2. 97  Statistical Test of the Variance

97  Statistical Test of the Variance

97.1 Theory

97.1.1 Statistical Hypothesis: Testing the Variance - Population

The population distribution of the random variable \(X\) is written as \(X \sim \text{N} \left( \mu, \sigma^2 \right)\) where \(\mu\) and \(\sigma^2\) represent the mean and variance of the normal distribution. In this representation it is assumed that \(\sigma^2\) is unknown. The parameter \(\mu\) can be either known or unknown.

97.1.2 Statistical Hypothesis: Testing the Variance - Sample

The statistic for the sample mean is \(\bar{x} = \frac{1}{n} \sum_{i=1}^n x_i\) where \(n\) is the number of observations in the sample. The sample statistic for the variance can be written in terms of \(\mu\) (if this population parameter is known) or in terms of the sample mean \(\bar{x}\):

\[ \begin{cases}\frac{\sum_{i=1}^{n}\left( x_i - \mu \right)^2}{\sigma^2} = \sum_{i=1}^{n} \left( \frac{x_i - \mu}{\sigma} \right)^2 = \frac{ns^2}{\sigma^2} \\\frac{\sum_{i=1}^{n}\left( x_i - \bar{x} \right)^2}{\sigma^2} = \sum_{i=1}^{n} \left( \frac{x_i - \bar{x}}{\sigma} \right)^2 = \frac{(n-1)s^2}{\sigma^2}\end{cases} \]

The distribution of the sample variance can be written in terms of \(\mu\) (if this population parameter is known) or in terms of the sample mean \(\bar{x}\):

\[ \begin{align*}\frac{\sum_{i=1}^{n} \left( x_i - \mu \right)^2 }{\sigma^2} \sim \chi_n^2 \\\frac{\sum_{i=1}^{n} \left( x_i - \bar{x} \right)^2 }{\sigma^2} \sim \chi_{n-1}^2\end{align*} \]

97.1.3 Statistical Hypothesis: Testing the Variance - Critical Region

Table 97.1: Hypotheses Overview
Null Hypothesis Alternative Hypothesis Critical Region
\(\sigma^2 \leq \sigma_0^2\) \(\sigma^2 > \sigma_0^2\) \(\chi^2 \geq \chi_{\alpha,df}^2\)
\(\sigma^2 \geq \sigma_0^2\) \(\sigma^2 < \sigma_0^2\) \(\chi^2 \leq \chi_{1-\alpha,df}^2\)
\(\sigma^2 = \sigma_0^2\) \(\sigma^2 \neq \sigma_0^2\) \(\begin{cases} \chi^2 \geq \chi_{\frac{\alpha}{2},df}^2 & \text{(upper tail)} \\ \chi^2 \leq \chi_{1-\frac{\alpha}{2},df}^2 & \text{(lower tail)} \end{cases}\)

97.1.4 The Chi-squared distribution

97.1.4.1 Definition

Let \(X\) be a stochastic variable following a normal distribution with expected value \(\mu\) and variance \(\sigma^2\):

\[ X \sim \text{N} \left( \mu, \sigma^2 \right) \]

From this it follows that

\[ u = \frac{X - \mu}{\sigma} \sim \text{N} (0, 1) \]

The \(\chi^2\)-distribution with one degree of freedom is defined as the square of a standard normal distributed variate, i.e.

\[ u^2 = \left( \frac{X - \mu}{\sigma} \right)^2 \sim \chi_1^2 \]

The \(\chi^2\)-distribution with \(n\) degrees of freedom is defined as the sum of \(n\) squared independent standard normal distributed variates:

\[ \sum_{i=1}^{n} u_i^2 = \sum_{i=1}^{n} \left( \frac{X_i - \mu}{\sigma} \right)^2 \sim \chi_n^2 \]

97.1.4.2 Property 1

The sum of two independent \(\chi^2\)-distributed variates, with degrees of freedom \(n_1\) and \(n_2\) respectively, is also \(\chi^2\)-distributed with degrees of freedom equal to \(n_1 + n_2\). In general, the difference of two independent \(\chi^2\) variates is not \(\chi^2\)-distributed.

97.1.4.3 Property 2

The expected value of a \(\chi^2\)-distributed variate is equal to the number of degrees of freedom:

\[ \text{E} \left( \chi_n^2 \right) = n \]

The variance of a \(\chi^2\)-distributed variate is equal to two times the number of degrees of freedom:

\[ \text{V} \left( \chi_n^2 \right) = 2n \]

97.1.5 Approximation of the Chi-squared distribution

97.1.5.1 Rule of thumb

For large samples, the distribution of

\[ \sqrt{2 \chi_n^2} - \sqrt{2 n - 1} \]

can be approximated by the standard normal distribution N\((0,1)\).

97.1.5.2 Example

Let \(n = 30\) and find the value \(c\) for which P\(\left( \chi_n^2 \geq c \right) = 0.05\).

Using the given approximation we obtain

\[ \begin{aligned}\text{P} \left( \sqrt{2 \chi_n^2} - \sqrt{2 n - 1} \geq \sqrt{2c} - \sqrt{2n - 1} \right) &= 0.05 \\\text{P} (u \geq k) &= 0.05\end{aligned} \]

Since \(k = 1.645\) it follows that the approximation results in \(c = 43.49\). According to the \(\chi^2\)-table, the correct value for the critical value is 43.773 (Appendix G). The approximation converges towards the correct value as \(n \rightarrow +\infty\).

97.1.6 Distribution of Sample Variance

97.1.6.1 Proof

\[ \begin{align*}\frac{ns^2}{\sigma^2} = \sum_{i=1}^{n} \left( \frac{x_i - \bar{x}}{\sigma} \right)^2 &= \sum_{i=1}^{n} \left[ \frac{\left( x_i - \mu \right) - \left( \bar{x} - \mu \right) }{\sigma} \right]^2 \\&= \sum_{i=1}^{n} \left[ \frac{(x_i - \mu)^2}{\sigma^2} + \frac{(\bar{x} - \mu)^2}{\sigma^2} - 2 \frac{(x_i - \mu) (\bar{x}-\mu)}{\sigma^2} \right] \\&= \sum_{i=1}^{n} \frac{(x_i - \mu)^2}{\sigma^2} + n \frac{(\bar{x}-\mu)^2}{\sigma^2} - 2 \frac{(\bar{x}-\mu)}{\sigma} \sum_{i=1}^{n} \frac{(x_i - \mu)}{\sigma} \\&= \sum_{i=1}^{n} \frac{(x_i - \mu)^2}{\sigma^2} + n \frac{(\bar{x}-\mu)^2}{\sigma^2} - 2 \frac{(\bar{x}-\mu)}{\sigma} \frac{\sum_{i=1}^{n} x_i - n \mu}{\sigma} \\&= \sum_{i=1}^{n} \frac{(x_i - \mu)^2}{\sigma^2} + n \frac{(\bar{x}-\mu)^2}{\sigma^2} - 2 \frac{(\bar{x}-\mu)}{\sigma} \frac{n \bar{x} - n \mu}{\sigma} \\&= \sum_{i=1}^{n} \frac{(x_i - \mu)^2}{\sigma^2} + n \frac{(\bar{x}-\mu)^2}{\sigma^2} - 2 \frac{(\bar{x}-\mu)}{\sigma} \frac{n (\bar{x} - \mu)}{\sigma} \\&= \sum_{i=1}^{n} \frac{(x_i - \mu)^2}{\sigma^2} - n \frac{(\bar{x}-\mu)^2}{\sigma^2} \\&= \sum_{i=1}^{n} \frac{(x_i - \mu)^2}{\sigma^2} - \left( \frac{(\bar{x}-\mu)}{\frac{\sigma}{\sqrt{n}}} \right)^2 \\\frac{ns^2}{\sigma^2} = \sum_{i=1}^{n} \left( \frac{x_i - \bar{x}}{\sigma} \right)^2 &= \sum_{i=1}^{n} \left( \frac{x_i - \mu}{\sigma} \right)^2 - \left( \frac{\bar{x}-\mu}{\frac{\sigma}{\sqrt{n}}} \right)^2\end{align*} \]

From a random sample, with sample size \(n\) and drawn from a population following a normal distribution and given mean and standard deviation, the sample variance can be estimated as described in the following cases.

97.1.6.2 Estimation -- Case 1: mean is unknown

\[ s^2 = \frac{1}{n} \sum_{i=1}^{n}\left( x_i - \bar{x} \right)^2 \]

which implies that

\[ \frac{ns^2}{\sigma^2} = \sum_{i=1}^{n} \left( \frac{x_i - \bar{x}}{\sigma} \right)^2 \]

This result can be easily rewritten as follows

\[ \begin{align*}\frac{ns^2}{\sigma^2} &= \sum_{i=1}^{n} \left( \frac{x_i - \mu}{\sigma} \right)^2 - n \left( \frac{\bar{x}-\mu}{\sigma} \right)^2 \\&= \sum_{i=1}^{n} \left( \frac{x_i - \mu}{\sigma} \right)^2 - \left( \frac{\bar{x}-\mu}{\frac{\sigma}{\sqrt{n}}} \right)^2 \\&= V - W\end{align*} \]

The right hand side consists of two parts:

  • \(V\): the sum of \(n\) squared independent standard normally distributed variates, i.e. \(V \sim \chi_n^2\)
  • \(W\): the squared standard normally distributed variate, i.e. \(W \sim \chi_1^2\)

It can be concluded that

\[ \frac{ns^2}{\sigma^2} = (V-W) \sim \left( \chi_n^2 - \chi_1^2 \right) \sim \chi_{n-1}^2 \]

97.1.6.3 Estimation -- Case 2: mean is known

An interesting consequence of the previous case is that the statistic \(\frac{ns^2}{\sigma^2} = \frac{n \frac{1}{n}\sum_{i=1}^{n}\left( x_i - \mu \right)^2}{\sigma^2}\) is also \(\chi^2\)-distributed but with \(n\) degrees of freedom instead of \(n-1\). The loss of one degree of freedom in the first case is due to the substitution of the unknown population parameter \(\mu\) by the sample mean \(\bar{x}\).

97.1.7 Summary

Table 97.2: Estimation of Variance -- Test Statistics & Distributions
Population \(\mu\) Estimation of \(\sigma^2\) Test Statistic & Distribution
\(\mu\) known \(\begin{cases} s^2 = \frac{1}{n} \sum_{i=1}^{n} \left( x_i - \mu \right)^2\\ s^2 = \frac{1}{n-1} \sum_{i=1}^{n} \left( x_i - \mu \right)^2 \end{cases}\) \(\begin{cases} \frac{n s^2}{\sigma^2} \sim \chi_n^2 \\ \frac{(n-1)s^2}{\sigma^2} \sim \chi_n^2 \end{cases}\)
\(\mu\) unknown \(\begin{cases} s^2 = \frac{1}{n} \sum_{i=1}^{n} \left( x_i - \bar{x} \right)^2 \\ s^2 = \frac{1}{n-1} \sum_{i=1}^{n} \left( x_i - \bar{x} \right)^2 \end{cases}\) \(\begin{cases} \frac{n s^2}{\sigma^2} \sim \chi_{n-1}^2 \\ \frac{(n-1)s^2}{\sigma^2} \sim \chi_{n-1}^2 \end{cases}\)

97.2 Examples

97.2.1 Statistical Hypothesis: Testing Variance -- Example 1: Critical Value (Region)

97.2.1.1 Problem

Find the value \(c\) if the following information is available:

  • Population Variance \(\sigma^2\): unknown
  • Population Mean \(\mu\): unknown
  • Sample Size \(n = 8\)
  • Sample Variance \(s^2 = 0.64\)
  • Sample Standard Deviation \(s = 0.80\)
  • Null Hypothesis for \(\sigma^2\): \(\sigma_0^2 = 0.36\)
  • Alternative Hypothesis H\(_A\): \(\sigma^2 > \sigma_0^2\) (right-sided test)
  • Type I Error \(\alpha = 0.05\)

97.2.1.2 Solution

\[ \begin{align*}\text{P}\left( s^2 \geq c \right) &= 0.05 \\\text{P} \left( \frac{(n-1)s^2}{\sigma^2} \geq \frac{(n-1)c}{\sigma^2} \right) &= 0.05\end{align*} \]

From Appendix G it follows that

\[ \begin{align*}\frac{(n-1)c}{\sigma^2} &= 14.0671 \\c &= \frac{\sigma^2}{n-1} 14.0671 = \frac{0.36}{7} 14.0671 \\c &= 0.72345\end{align*} \]

Hence P\(\left( s^2 \geq 0.72345 \right) = 0.05\).

97.2.1.3 Conclusion

Since \(s^2 = 0.64\) is smaller than \(c = 0.72345\) there is no reason to reject the Null Hypothesis.

97.2.1.4 Software

The R module is available on the public website:

https://compute.wessa.net/rwasp_hypothesisvariance1.wasp

To compute this Hypothesis Test on your local machine, the following script can be used in the R console:

par1 = 8 #Sample size 
par2 = 0.64 #Sample Variance 
par3 = 0.36 #Null hypothesis 
par4 = 0.05 #Type I error (alpha) 
df <- par1 - 1
if (par2 > par3) {
  myc <- par3 / df * qchisq(1-par4,df)
} else {
  myc <- par3 / df * qchisq(par4,df)
}
print(myc)
[1] 0.7234529

97.2.2 Statistical Hypothesis: Testing Variance -- Example 2: p-value (probability)

97.2.2.1 Problem

Find the p-value if the following information is available:

  • Population Variance \(\sigma^2\): unknown
  • Population Mean \(\mu\): unknown
  • Sample Size \(n = 8\)
  • Sample Variance \(s^2 = 0.64\)
  • Sample Standard Deviation \(s = 0.80\)
  • Null Hypothesis for \(\sigma^2\): \(\sigma_0^2 = 0.36\)
  • Type I Error \(\alpha = 0.05\)

97.2.2.2 Solution

\[ \frac{(n-1)s^2}{\sigma^2} = \frac{(8-1) 0.64}{0.36} = \frac{7 \times 0.64}{0.36} \simeq 12.44 \]

Hence P\(\left( \chi_7^2 \geq 12.44 \right) = 0.0869\). Note: the exact p-value cannot be determined based on Appendix G (it is only possible to use an approximate interpolation). With the use of statistical software, however, it is possible to obtain the exact p-value.

97.2.2.3 Conclusion

Since the probability \(0.0869\) is larger than \(\alpha = 0.05\) there is no reason to reject the Null Hypothesis.

97.2.2.4 Software

The R module is available on the public website:

https://compute.wessa.net/rwasp_hypothesisvariance2.wasp

To compute this Hypothesis Test on your local machine, the following script can be used in the R console:

par1 = 8 #Sample size 
par2 = 0.64 #Sample Variance 
par3 = 0.36 #Null hypothesis 
par4 = 0.05 #Type I error (alpha) 
df <- par1 - 1
myc <- df * par2 / par3
print(myc)
if (par2 > par3)
{
  myp <- 1 - pchisq(myc,df)
} else {
  myp <- pchisq(myc,df)
}
print(myp)
[1] 12.44444
[1] 0.08685819

97.2.3 Statistical Hypothesis: Testing Variance -- Example 3: Acceptance Regions for Sample Variance (under H\(_0\))

97.2.3.1 Problem

Find the acceptance region (under H\(_0\)) for the Sample Variance if the following information is available:

  • Population Variance \(\sigma^2\): unknown
  • Population Mean \(\mu\): unknown
  • Sample Size \(n = 8\)
  • Null Hypothesis for \(\sigma^2\): \(\sigma_0^2 = 0.36\)
  • Probability level under H\(_0\) for \(s^2\): \(0.90\)

97.2.3.2 Solution

\[ \begin{align*}&\text{P}\left( a \leq s^2 \leq b \right) &= 0.90 \\&\text{P}\left( \frac{(n-1)a}{\sigma^2} \leq \frac{(n-1)s^2}{\sigma^2} \leq \frac{(n-1)b}{\sigma^2} \right) &= 0.90\end{align*} \]

Based on Appendix G and Appendix H it is possible to determine the upper and lower tail critical values

\[ \begin{align*} \frac{(n-1)b}{\sigma^2} &= 14.067 \\ b &= \frac{\sigma^2}{(n-1)} 14.067 = \frac{0.36}{7} 14.067 \simeq 0.72345 \\ \frac{(n-1)a}{\sigma^2} &= 2.16735 \\ a &= \frac{\sigma^2}{(n-1)} 2.16735 = \frac{0.36}{7} 2.16735 \simeq 0.11146 \\ \end{align*} \]

Hence

\[ \text{P}\left( 2.167 \leq \chi_7^2 \leq 14.067 \right) = 0.90 \]

97.2.3.3 Conclusion

The two-sided 90% acceptance region for the Sample Variance \(s^2\) (under H\(_0\)) is \([0.11146, 0.72345]\). In other words, P\(\left( 0.11146 \leq s^2 \leq 0.72345 \right) = 0.90\).

97.2.3.4 Software

The R module is available on the public website:

https://compute.wessa.net/rwasp_hypothesisvariance3.wasp

To compute this Hypothesis Test on your local machine, the following script can be used in the R console:

par1 = 8 #Sample size 
par2 = 0.36 #Null hypothesis 
par3 = 0.90 #Confidence Interval
df <- par1 - 1
halfalpha <- (1 - par3) / 2
ua <- qchisq(halfalpha,df) * par2 / df
ub <- qchisq(1-halfalpha,df) * par2 / df
#Two-sided confidence interval
print(ua)
print(ub)
#Left one-sided confidence interval [ul, +inf]
ul <- qchisq(1-par3,df) * par2 / df
print(ul)
#Right one-sided confidence interval [0, ur]
ur <- qchisq(par3,df) * par2 / df
print(ur)
[1] 0.1114637
[1] 0.7234529
[1] 0.1457026
[1] 0.618019

97.2.4 Statistical Hypothesis: Testing Variance -- Example 4: Confidence Intervals for Population Variance

97.2.4.1 Problem

Find the Confidence Interval for the Population Variance if the following information is available:

  • Population Variance \(\sigma^2\): unknown
  • Population Mean \(\mu\): unknown
  • Sample Size \(n = 8\)
  • Sample Variance \(s^2 = 0.64\)
  • Sample Standard Deviation \(s = 0.80\)
  • Confidence level for \(s^2\): \(0.90\)

97.2.4.2 Solution

\[ \begin{align*}&\text{P}\left( a \leq \sigma^2 \leq b \right) &= 0.90 \\&\text{P}\left( \frac{1}{b} \leq \frac{1}{\sigma^2} \leq \frac{1}{a} \right) &= 0.90 \\&\text{P}\left( \frac{(n-1)s^2}{b} \leq \frac{(n-1)s^2}{\sigma^2} \leq \frac{(n-1)s^2}{a} \right) &= 0.90\end{align*} \]

Based on Appendix G and Appendix H it is possible to determine the upper and lower tail critical values

\[ \begin{align*}\frac{(n-1)s^2}{b} &= 2.16735 \\b &= \frac{(n-1)s^2}{2.16735} = \frac{7 \times 0.64}{2.16735} \simeq 2.06704 \\ \frac{(n-1)s^2}{a} &= 14.067 \\a &= \frac{(n-1)s^2}{14.067} = \frac{7 \times 0.64}{14.067} \simeq 0.31847 \\ \end{align*} \]

97.2.4.3 Conclusion

The two-sided 90% Confidence Interval for the Population Variance \(\sigma^2\) is \([0.31847, 2.06704]\). In other words, P\(\left( 0.31847 \leq \sigma^2 \leq 2.06704 \right) = 0.90\).

97.2.4.4 Software

The R module is available on the public website:

https://compute.wessa.net/rwasp_hypothesisvariance4.wasp

To compute this Hypothesis Test on your local machine, the following script can be used in the R console:

par1 = 8 #Sample size 
par2 = 0.64 #Sample Variance
par3 = 0.90 #Confidence Interval
df <- par1 - 1
halfalpha <- (1 - par3) / 2
ub <- par2 * df / qchisq(halfalpha,df)
ua <- par2 * df / qchisq(1-halfalpha,df)
#Two-sided confidence interval
print(ua)
print(ub)
#Right one-sided confidence interval [0, ur]
ur <- par2 * df / qchisq(1-par3,df)
print(ur)
#Left one-sided confidence interval [ul, +inf]
ul <- par2 * df / qchisq(par3,df)
print(ul)
[1] 0.3184727
[1] 2.06704
[1] 1.581303
[1] 0.3728041
96  Statistical Test of the Population Mean with unknown Variance
98  Statistical Test of the Population Proportion

© 2026 Patrick Wessa. Provided as-is, without warranty.

Feedback: e-mail | Anonymous contributions: click to copy (Sats) | click to copy (XMR)

Cookie Preferences