Learn R Programming

paleoTS (version 0.3-1)

test.var.het: Variance heterogeneity test

Description

Tests for heterogeneity of sample variances in a paleoTS object.

Usage

test.var.het(y, method = "Bartlett")
pool.var(y, nn=NULL, ret.paleoTS=FALSE)

Arguments

y
a paleoTS object
method
test to be used; currently only Bartlett's test is implemented
nn
if y is a vector of variances, nn is a vector of sample sizes
ret.paleoTS
logical, indicating if the function should return a new paleoTS object with variances replaced by pooled variance.

Value

  • Function pool.var either returns a paeloTS object, or the pooled variance. Function test.var.het returns a list with the following elements relevant to Bartlett's test
  • stattest statistic for Bartlett's test
  • p.valueP-vlaue for statistical test
  • dfdegrees of freedom, equal to one fewer than the number of samples

Details

Tests for variance heterogeneity among samples. In the absence of evidence for heterogeniety, it may be desirable to replace individual estimates of phenotypic variance with a variance estimate pooled over all samples. Function pool.var is used internally in test.var.het. It returns the value of the pooled variance.

References

Hunt, G. 2006. Fitting and comparing models of phyletic evolution: random walks and beyond. Paleobiology32:578--601. Sokal, R. and F. J. Rohlf 1995. Biometry, 3rd Ed.

Examples

Run this code
# generate simulated data with no real variance heterogeneity
y <- sim.GRW(20, 0, 1)
bart <- test.var.het(y)   # nonsignificant 95% of the time!
ys<- pool.var(y, ret.paleoTS=TRUE)
cat (ys$vv)		# note all variances now the same

Run the code above in your browser using DataLab