Learn R Programming

PairedData (version 0.9.9)

var.test: Tests of variance(s) for normal distribution(s)

Description

Classical tests of variance for one-sample, two-independent samples or paired samples.

Usage

## S3 method for class 'default':
var.test(x, y = NULL, ratio = 1, alternative = c("two.sided", 
    "less", "greater"), paired = FALSE, conf.level = 0.95, ...)

## S3 method for class 'paired':
var.test(x, ...)

## S3 method for class 'default':
pitman.morgan.test(x, y = NULL, alternative = c("two.sided", "less", "greater"), 
    ratio = 1, conf.level = 0.95,...)

Arguments

x
first sample or an object of class paired or an object of class lm.
y
second sample or an object of class lm.
ratio
a priori ratio of variances (two-samples) or variance (one-sample).
alternative
alternative hypothesis.
paired
independent (the default) or paired samples.
conf.level
confidence level.
...
further arguments to be passed to or from methods.

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the X-squared statistic (one-sample) or F-statistic (two-samples).
  • parameterthe degrees of freedom for the statistic.
  • p.valuethe p-value for the test.
  • conf.inta confidence interval for the parameter appropriate to the specified alternative hypothesis.
  • estimatethe estimated variance(s).
  • null.valuethe specified hypothesized value of the parameter.
  • alternativea character string describing the alternative hypothesis.
  • methoda character string indicating what type of test was performed.
  • data.namea character string giving the name(s) of the data.

References

  • Morgan, W.A. (1939) A test for the significance of the difference between two variances in a sample from a normal bivariate distribution. Biometrika, 31, 13-19.
  • Pitman, E.J.G. (1939) A note on normal correlation. Biometrika, 31, 9-12.

See Also

bonettseier.var.test, grambsch.var.test

Examples

Run this code
data(HorseBeginners)

#one sample test
var.test(HorseBeginners$Actual,ratio=15)

# two independent samples test
var.test(HorseBeginners$Actual,HorseBeginners$Imaginary)

# two dependent samples test
var.test(HorseBeginners$Actual,HorseBeginners$Imaginary,paired=TRUE)
p<-with(HorseBeginners,paired(Actual,Imaginary))
var.test(p)

Run the code above in your browser using DataLab