C.test: Cochran's C test of homogeneity of variances

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Performs a Cochran's test of the null hypothesis that the largest variance in several sampled variances are the same.

Usage

1
C.test(object)

Arguments

object

An object of class lm, containing the specified design.

Details

The test statistic is a ratio that relates the largest variance to the sum of the sampled variances.

Value

A list of class htest containing the following components:

statistic

Cochran's C test statistic

p-value

The p-value of the test

alternative

A character string describing the alternative hypothesis

method

The character string Cochran test of homogeneity of variances

data.name

A character string giving the name of the lm object

estimate

Sample estimates of variances

Author(s)

Leonardo Sandrini-Neto (leonardosandrini@gmail.com)

See Also

gad

Examples

1
2
3
4
5
6
  library(GAD)
  data(rohlf95)
  cg <- as.fixed(rohlf95$cages)
  mq <- as.random(rohlf95$mosquito) 
  model <- lm(wing ~ cg + mq%in%cg, data = rohlf95)
  C.test(model)

Example output

Loading required package: matrixStats
Loading required package: R.methodsS3
R.methodsS3 v1.7.1 (2016-02-15) successfully loaded. See ?R.methodsS3 for help.

	Cochran test of homogeneity of variances

data:  model
C = 0.30762, n = 2, k = 12, p-value = 0.5899
alternative hypothesis: Group cage1.m2 has outlying variance
sample estimates:
cage1.m1 cage1.m2 cage1.m3 cage1.m4 cage2.m1 cage2.m2 cage2.m3 cage2.m4 
   0.500    4.805    0.080    1.620    0.000    1.125    0.980    2.000 
cage3.m1 cage3.m2 cage3.m3 cage3.m4 
   0.405    0.980    0.245    2.880 

GAD documentation built on May 2, 2019, 3:01 a.m.