Compute the test of hypothesis and compute a confidence interval on the variance of a population.

sigma.test(x, sigma = 1, sigmasq = sigma^2,
  alternative = c("two.sided", "less", "greater"), conf.level = 0.95, ...)

Arguments

x

Vector of data values.

sigma

Hypothesized standard deviation of the population.

sigmasq

Hypothesized variance of the population.

alternative

Direction of the alternative hypothesis.

conf.level

Confidence level for the interval computation.

...

Additional arguments are silently ignored.

Details

Many introductory statistical texts discuss inference on a single population variance and introduce the chi-square test for a population variance as another example of a hypothesis test that can be easily derived. Most statistical packages do not include the chi-square test, perhaps because it is not used in practice very often, or because the test is known to be highly sensitive to nonnormal data. For the two-sample problem, see var.test.

Value

An object of class htest containing the results

Author

G. Jay Kerns gkerns@ysu.edu

Note

This test is highly sensitive to nonnormality.

See also

Examples

x <- rnorm(20, mean = 15, sd = 7)
sigma.test(x, sigma = 6)
#> 
#> 	One sample Chi-squared test for variance
#> 
#> data:  x
#> X-squared = 35.347, df = 19, p-value = 0.02536
#> alternative hypothesis: true variance is not equal to 36
#> 95 percent confidence interval:
#>   38.73411 142.87355
#> sample estimates:
#> var of x 
#> 66.97398 
#>