Learn R Programming

TRSbook (version 1.0.2)

sigma2.test: Test of a variance

Description

Comparing the theoretical variance with a reference value

Usage

sigma2.test(x, alternative = "two.sided", var0 = 1, conf.level = 0.95)

Arguments

x

numeric vector

alternative

Alternative hypothesis for the test. Either two sided ("two.sided"), one sided to the left ("less") or one sided to the right ("greater"). Default is "two.sided".

var0

value of reference for the variance

conf.level

confidence level

Value

Returns a list:

statistic

Value of the test statistic

parameter

degrees of freedom

p.value

p-value of the test

conf.int

confidence interval

estimate

sample variance

null.value

value of reference for the variance

alternative

Alternative hypothesis for the test

method

"One-sample Chi-squared test for given variance"

data.name

name of the data set

References

Chapter 13 (Confidence Intervals and Hypothesis Testing) from the book: The R Software, Fundamentals of Programming and Statistical Analysis

Examples

Run this code
# NOT RUN {
data(NUTRIELDERLY)
sigma2.test(NUTRIELDERLY$weight,conf.level=0.9)$conf
# }

Run the code above in your browser using DataLab