var_test | R Documentation |
This function performs the test for a single variance or two variances using values, not the vectors.
var_test(
varx,
nx,
vary = NULL,
ny = NULL,
alternative = "two.sided",
null.value = 1,
conf.level = 0.95
)
varx |
sample variance for sample x. |
nx |
sample size for sample x. |
vary |
sample variance for sample y. |
ny |
sample size for sample y. |
alternative |
a character string specifying the alternative
hypothesis, must be one of |
null.value |
the hypothesized number (variance or ratio of the variances) in the null hypothesis. |
conf.level |
confidence level of the interval, by default its value is 0.95. |
A list with class htest
containing the following
components:
statistic |
the value of the statistic. |
p.value |
the p-value for the test. |
conf.int |
a confidence interval for the variance. |
estimate |
the sample variance (or ratio of the sample variances) |
null.value |
the specified hypothesized value for alternative hypothesis. |
alternative |
a character string describing the alternative hypothesis. |
method |
a character string indicating the type of test performed. |
# Examples with ONE sample
# Example 7.7.1 from Wayne (2013), http://tinyurl.com/y6z49hrw
var_test(varx=670.81, nx=16, null.value=600, alternative='two.sided')
# Exercise 7.7.5 from Wayne (2013), http://tinyurl.com/y6z49hrw
var_test(varx=30, nx=25, null.value=25, alternative='greater')
# Using the plot to illustrate Hypothesis Test
mytest1 <- var_test(varx=30, nx=25, null.value=25, alternative='greater')
mytest1
plot(mytest1)
# Examples with TWO samples
# Example 7.8 from Montgomery (1996)
var_test(varx=5.1^2, nx=12, vary=4.7^2, ny=15, conf.level=0.90)
# Example 8.17 from Montgomery (1996)
mytest2 <- var_test(varx=3.84, nx=20, vary=4.54, ny=20)
mytest2
plot(mytest2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.